title: JPanel won't paint correctly
body: <p>I am quite new to Java and Swing, and this is also my first post so sorry if it doesn't make too much sense.</p>
  
  <p>What I am trying to do is when I click on a JPanel, I want it to add a circle where I click. At the moment, all that seems to happen is when I click, a small grey square appears inside the JPanel I want to add to, but I can't seem to find any way of making it draw as a circle.</p>
  
  <p>I have a class that extends JPanel called "Ball" which is what is being added when I click.
  At the moment, I am not too worried about it being in the correct location, just for it to draw the ball correctly.
  Below is the code for my "Ball" class:</p>
  
  <pre><code>package paintsliders;
  import java.awt.Color;
  import java.awt.Graphics;
  import javax.swing.JPanel;
  
  class Ball extends JPanel{
  
  private int x,y,w,h;
  
  //I will use this constructor to put the ball in the correct location later.
  Ball(){
      /*this.w = 100;
      this.h = 100;
      this.x = 200;
      this.y = 200;*/
  }
  
  //draw the ball
      @Override
  public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawOval(200,200,10,10);
        g.setColor(Color.RED);
      }
  
  }
  </code></pre>
  
  <p>I can kind of guess that it is something to do with the paintComponent method, but everywhere I have looked doesn't seem to have a solution for me.</p>
  
  <p>Any help would be great, thanks!</p>