title: setBounds method isn't working properly?
body: <p>Well the title explains it, basically the <code>setBounds(int x, int y, int width, int height)</code> method isn't working like I want it too as nothing is being displayed. The point of this code is to get the text from some text fields then close that window and and convert them to <code>JLabel</code> objects to be displayed on the screen but it doesn't do that. Here are some code fragments:</p>
  
  <pre><code>public class Create implements ActionListener {
  
      private JTextArea t1, t2, t3;
      private String s1 = t1.getText();
      private String s2 = t2.getText();
      private String s3 = t3.getText();
      public void actionPerformed(ActionEvent e) {
  
          if (e.getSource() == b1) {
              dispose();
              setVisible(false);
              t1 = new JTextArea(7, 17);
              t2 = new JTextArea(7, 17);
              t3 = new JTextArea(7, 17);
  
              JFrame frame2 = new JFrame();
              frame2.add(new Test(s1,s2,s3));
              frame2.setTitle("Title");  
              frame2.setSize(700,500);
              frame2.setResizable(true);
              frame2.setLocationRelativeTo(null);
              frame2.setVisible(true);
          }
      }
  }
  </code></pre>
  
  <p>New class <code>Test</code>:</p>
  
  <pre><code>import java.awt.Color;
  import java.awt.Component;
  import java.awt.Graphics;
  import java.awt.Graphics2D;
  import java.awt.Shape;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.geom.Rectangle2D;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import javax.swing.Timer;
  
  @SuppressWarnings("serial")
  public class Test extends JPanel implements ActionListener {
  
      private int w = 250, velx = 2, x = 330;
      Timer tm = new Timer(50,this);
  
      public Test(String s1, String s2, String s3) {
          setText(s1, s2, s3);
      }
  
      public void setText(String s1, String s2, String s3) {
          JLabel label1 = new JLabel(s1);
          label1.setBounds(100, 100, 500, 500);
          JLabel label2 = new JLabel(s2);
          label2.setBounds(75, 20, 100, 20);
          JLabel label3 = new JLabel(s3);
          label3.setBounds(100, 20, 100, 20);
      }
  }
  </code></pre>
  
  <p>*****String won't draw on top of rectangle*****</p>
  
  <pre><code>public void paintComponent(Graphics g){
  
  
         super.paintComponent(g);
  
         g.drawString("something", 300, 50);
         g.drawString("something", 50, 100);
         g.drawString("something", 50, 150);
  
  
  
  }
  
  public void paint(Graphics g){
       tm.setInitialDelay(10000);
       super.paint(g);
       Graphics2D graph2 = (Graphics2D)g;
  
       Shape Rect1 = new Rectangle2D.Float(330, 30, 250, 390);
       graph2.setColor(Color.CYAN);
       graph2.fill(Rect1);
  
       Shape Rect2 = new Rectangle2D.Float(x, 30, w, 390);
       graph2.setColor(Color.RED);
       graph2.fill(Rect2);
  
       tm.start();
  
  
      }
  </code></pre>