title: How to draw a circle on to panel in java swing
body: <p>I am trying to draw a circle for a game I am making for a class. </p>
  
  <p>This is my code:</p>
  
  <pre><code>public void paintComponent(Graphics g) {
      super.paintComponent(g);
      Graphics2D g2d = (Graphics2D)g;
      // Assume x, y, and diameter are instance variables.
      Ellipse2D.Double circle = new Ellipse2D.Double(50, 50, 150, 150);
  }
  </code></pre>
  
  <p>However, when I run the code, it is not seen (My frame is 300 by 300)</p>