title: JScrollPane nullifies the width attribute of my JList cells
body: <p>I have a <strong>JFrame</strong> which consists only of a <strong>JList</strong>, the <strong>JList</strong> has its own cell renderer, in the cell renderer a <strong>JTextPane</strong> is returned with a custom size. The custom size has the result that the lines of this text panes are wrapped.</p>
  
  <pre><code>textPane.setSize(WIDTH, HEIGHT);
  </code></pre>
  
  <p>Now I want to make this JList scrollable, so I wrap it into a JScrollPane component, this however, nullifies the width constraints I have defined in the cell renderer. What would be the best way to enforce the width constraint in the JScrollPane?</p>
  
  <pre><code>setSize(FRAME_WIDTH, FRAME_HEIGHT);
  setLayout(new BorderLayout());
  
  DefaultListModel&lt;Status&gt; listModel = new DefaultListModel&lt;Status&gt;();
  JList&lt;Status&gt; list = new JList&lt;&gt;(listModel);
  list.setLayout(new BorderLayout());
  list.setSize(FRAME_WIDTH, FRAME_HEIGHT);
  list.setCellRenderer(new MyCellRenderer());
  // wrap the list with a JScrollPane
  add(new JScrollPane(list), BorderLayout.CENTER);
  </code></pre>