title: Java: drawing circles with recursion
body: <p>So I am trying to get my program to draw circles through recursion. Each time it steps into the recursion the radius of the circle should increase by 10. Here is what it should look like:<img src="https://i.stack.imgur.com/OmjfD.png" alt="enter image description here"></p>
  
  <p>but when i run this code to draw on the panel:</p>
  
  <pre><code>class CirclePanel extends JPanel{
  public int radius = 25;
  int xPossition = 250;
  int yPossition = 250;
      @Override
  public void paintComponent(Graphics g){
      super.paintComponents(g);
  
      g.setColor(Color.BLUE);
      g.drawOval(250, 250, radius, radius);
      radius += 10;
  
      if (radius + 10 &lt; 250){
      paintComponent(g);
      }
      }
  
  
  }
  </code></pre>
  
  <p>i get this:</p>
  
  <p><img src="https://i.stack.imgur.com/MSI27.png" alt="enter image description here"></p>
  
  <p>why does the center point of the circle change if i have it set to a constant 250?</p>