title: Make JScrollPane display scrollbars when JList inside is changed
body: <p>I'm trying to change a JList inside a JScrollPane dynamically, using</p>
  
  <pre><code>myList.setListData(someArray);
  </code></pre>
  
  <p>After this I would expect the JScrollPane to show Scrollbars as needed, but this doesn't happen. Googling the issue was not very helpful. I tried various combinations of the following methods, with little success (basically poking through the api docs):</p>
  
  <pre><code>myScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  myList.validate(); myScrollPane.validate();
  myScrollPane.setPreferredSize(Dimension someDimension);
  myScrollPane.setViewportView(moduleList);
  myScrollPane.setLayout(...);
  </code></pre>
  
  <p>When using the first method a scrollbar appears, but it doesn't get activated by the model change. I also hooked into the PropertyChangeEvent and validated that the JList fires and event when the model changed. What am I missing here? What method do I have to use to make this work, or even better what property would make this work out of the box?</p>