title: JScrollPane cannot detect text in need of scrolling
body: <p>This is a simplified version of my code, if this is not enough to diagnose the problem, comment and I'll post more code:</p>
  
  <pre><code>//All Necessary Imports
  
  JFrame window;
  Container container;
  JPanel mainTextPanel;
  JScrollPane scrollPane;
  JTextArea mainText;
  Font normalFont = new Font("Times New Roman", Font.PLAIN,30);
  
  ChoiceHandler choiceHandler = new ChoiceHandler();
  
  //Unrelated Variables
  
  public class setUp()
  {
      public setUp()
      {
          window = new JFrame();
          window.setSize(825,600);
          window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          window.getContentPane().setBackground(Color.white);
          window.setLayout(null);
  
          container = window.getContentPane();
  
          mainTextPanel = new JPanel();
          mainTextPanel.setBounds(100,100,600,250);
          mainTextPanel.setBackground(Color.white);
          container.add(mainTextPanel);
  
          //more code goes here
      }
  }
  
  public class mainText extends setUp
  {
      public mainText()
      {
          mainText = new JTextArea("Tons of text here");
          mainText.setBounds(100,100,600,250);
          mainText.setBackground(Color.white);
          mainText.setForeground(Color.black);
          mainText.setFont(normalFont);
          mainText.setLineWrap(true);
          scrollPane = new 
          JScrollPane(mainText,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  
          mainTextPanel.add(scrollPane);
          mainTextPanel.revalidate();
          mainTextPanel.repaint();
          mainTextPanel.setVisible(true);
  
          //more code goes here
      }
  }
  </code></pre>
  
  <p>My problem is that when I run the code, everything works except that the ScrollPane apparently cannot detect the fact that the text is out of bounds. The scrollbar is there, the only problem is that you cannot scroll with it, it looks like a scroll bar from when the text does not exceed the limit.</p>
  
  <p>When I removed the ALWAYS modifier in creating the scrollbar, the scrollbar disappears, again demonstrating that the scrollbar simply does not detect the out-of-bounds text.</p>