title: How to make user-resizable JTextArea?
body: <p>Seems like the only option is to set number of rows, but I need my text area to be resizable for user.
  JScrollPane helps, but when there's a lot of text, I want to let user resize the area itself.</p>
  
  <p>How do I do this? If I can use another class for this purpose, I'll be totally ok with it.</p>
  
  <p>Simplified code is</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  
  public class Problematic {
  
      public static void main(String[] args) {
          JFrame f = new JFrame("frame");
          f.setLayout(new BorderLayout());
  
          JPanel p1 = new JPanel();
          JPanel p = new JPanel();
  
          JButton button = new JButton("Whatever here");
          JTextArea t2 = new JTextArea(5, 30);
  
          JScrollPane scrollPane = new JScrollPane(t2);
  
          scrollPane.setSize(600, 400);
          scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  
          t2.setText("this is some random text\nthat may go for many rows\nso it may look messy");
  
          p1.add(button);
          p.add(scrollPane);
  
          f.add(p, BorderLayout.NORTH);
          f.add(p1, BorderLayout.CENTER);
  
          f.setSize(600, 500);
          f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
          f.setVisible(true);
      }
  }
  </code></pre>