title: Draw circles that are created as instances in Java GUI
body: <p>So I've been stuck on this problem for a while now and I'm desperate for help. Please help me. I've got 3 classes:</p>
  
  <p>Circle is just suppose to draw a circle in the frame created by Frame with random starting position (and defind the radius).</p>
  
  <p>Frame is the mainclass with methods such as addCircle(), bounce(), start(), stop(), run() (moves the circles) and quit(). This class also creates the frame in which the circles are added to.</p>
  
  <p>Interfa is just for now a inteface frame where I define the radius, number of circles and Frame size.</p>
  
  <p>No matter what I try I cannot add more than two circle (one is colored and one is not):</p>
  
  <p><strong>The "recursive way":</strong></p>
  
  <pre><code> private static void addCircle(int n){
      Circle[] circles = new Circle[n+10];
      if (n &gt; 0){
        circles[circleAdd] = new Circle();
        frame.add(circles[circleAdd]);
        circleAdd = circleAdd + 1;
        addCircle(n-1);
      }
    }
  </code></pre>
  
  <p><strong>Normal itterative way</strong></p>
  
  <pre><code>  private static void addCircles(int n){
    ArrayList&lt;Circle&gt; circles = new ArrayList&lt;Circle&gt;();
    for(int i = 0; i&lt;=n;i++){
    circles.add(new Circle());
    frame.add(circles.get(i)); 
    }
  }
  </code></pre>
  
  <p><strong>This is how I create my Frame:</strong></p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  import java.util.*;
  
  public Class Frame{
  
    private static JFrame frame;
    private static int circleAdd = 0;
    private static JPanel fra;
  
    public static void mainFrame(){
      frame = new JFrame();
      frame.setSize(500,500);
      frame.setVisible(true);
      fra = new JPanel();
      frame.add(fra);
  ...
  //addCircle and addCircles
  ...
  public static void main..
    } 
  }
  </code></pre>
  
  <p><strong>This is my circle:</strong></p>
  
  <pre><code>import java.awt.*;   
  import javax.swing.*;
  import java.util.Random;
  
  public class Circle extends JPanel{
    private Random random = new Random();
  
    public void paint(Graphics g){
  
      int randX = random.nextInt(250)+50;
      int randY = random.nextInt(250)+50;
      g.drawOval(randX,randY,50,50);
      g.setColor(Color.ORANGE);
      g.fillOval(100,100,50,50);
    }
  
  }
  </code></pre>