title: How can we add JScrollPane on JTextArea in java?
body: <p>Can anybody tell me what is the problem in following program? I want to fit <code>JScrollPane</code> on <code>JtextArea</code> but when I add it then <code>JTextArea</code> is not visible.</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  
  class Area extends JFrame
  {
      private JTextArea ta;
      private JTextField tf;
      JScrollPane jp;
  
      public Area()
      {
         super("Text Area");
         tf=new JTextField();
         tf.setBounds(100,350,300,30);
         add(tf);
         ta=new JTextArea();
         ta.setBounds(100,100,300,200);
         jp= new JScrollPane(ta);
         add(jp);
         setLayout(null);
         setSize(500,500);
         setVisible(true);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     }
  
     public static void main(String...s)
     {
        new Area();
     }
  }
  </code></pre>