title: Add an object from another class to a JPanel
body: <p>Ok i have a JPanel such as this one :</p>
  
  <pre><code>public class GUI {
  JFrame frame = new JFrame("Net");
  
  JPanel panel = new JPanel();
  public GUI()
  {
  frame.setSize(835,650);
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.setVisible(true);          
  frame.add(panel);
  panel.setSize(600,600);
  panel.setLocation(215,5);}
  </code></pre>
  
  <p>There are some other panels in there tables etc. My main is this one :</p>
  
  <pre><code>public static void main(String[] args) {
  
     SwingUtilities.invokeLater(new Runnable(){ 
      @Override
      public void run(){
      //new GUI();
      new GUI().buildTable();
  
       }
  
     });
  </code></pre>
  
  <p>And there i another class this one :</p>
  
  <pre><code>public class DrawPlanes extends GUI 
  {    
  
  private static int centreX, centreY, radius;
  private Color colour;
  
  public DrawPlanes()
  {
  centreX = 300;
  centreY = 300;
  radius = 200;
  colour = Color.BLACK;
  }
  
  public DrawPlanes(int centreX,int centreY, int radius, Color colour)
  {
  this.centreX = centreX;
  this.centreY = centreY;
  this.radius = radius;
  this.colour = colour;
  
  }
  
  @Override
  protected void paintComponent(Graphics g)
  {
  
    super.paintComponent(g);
    System.out.println("ppp");
    Graphics2D g2D = (Graphics2D) g;           
    g2D.setStroke(new BasicStroke(2F));  
    g.setColor(Color.BLACK);
    g.drawOval(centreX - radius , centreY - radius, radius * 2 , radius * 2);
    ......
      }
     }
  </code></pre>
  
  <p>Now i cant add this class to my panel i tried creating an object in main and then adding the object to my panel. I ve also tried </p>
  
  <pre><code>panel.add(new DrawPlanes(int x, int y, int radius,Color colour));
  </code></pre>
  
  <p>but it didnt get the drawing added in the panel.Any suggestions?</p>