title: How to get scrollbar to appear on a JList when the frame is too small to show all of the JList?
body: <p>I want to make a scrollbar appear on a JList whenever the frame is resized to be too small for the List itself.  So far, this is the code I have.  Run it, resize the frame, and notice how no scrollbar ever appears on the JList.</p>
  
  <pre><code>import java.awt.Dimension;
  
  import javax.swing.JFrame;
  import javax.swing.JList;
  import javax.swing.JPanel;
  import javax.swing.JScrollPane;
  
  
  public class JListScroll extends JPanel{
  
  JScrollPane listScrollPane;
  
  public JListScroll() {
      String[] stringArray = {"Testing","This","Stuff"};
      JList&lt;String&gt; rowList = new JList&lt;String&gt;(stringArray);
      listScrollPane = new JScrollPane();
      listScrollPane.getViewport().setView(rowList);
      this.setSize(new Dimension(75,200));
      this.add(listScrollPane);
      this.doLayout();
  }
  
  public static void main(String[] args){
      JFrame frame = new JFrame();
      JListScroll scrollPanel = new JListScroll();
      frame.add(scrollPanel);
      frame.setVisible(true);
      frame.setSize(new Dimension(75,300));
  }
  
  }
  </code></pre>
  
  <p>Notice how there is a JScrollPane added, but no scroll bar appears on the list when the window gets really small.  This is what I want to fix.</p>
  
  <p>Thanks in advance!</p>