title: Draw multiple moving graphics
body: <p>I have already made this program able to draw an instance of a small ball bouncing around a screen using these two classes</p>
  
  <pre><code>import java.awt.Graphics;
  import java.awt.Graphics2D;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.geom.Ellipse2D;
  
  import javax.swing.JPanel;
  import javax.swing.Timer;
  
  public class move extends JPanel implements ActionListener
  {
      Timer t = new Timer(7, this);
      int x = 10, y = 10, velX = 7, velY = 7;
  
      public void paintComponent(Graphics g, Graphics h)
      {
          super.paintComponent(h);
          super.paintComponent(g);
          System.out.println(g);
          Graphics2D g2 = (Graphics2D) g;
          Ellipse2D circle = new Ellipse2D.Double(x, y, 40, 40);
          g2.fill(circle);
          t.start();
      }
  
      public void actionPerformed(ActionEvent e) {
          if(x&lt;0 || x &gt; getWidth())
          {
              velX = -velX;
          }
          if(y &lt; 0 || y &gt; getHeight())
          {
              velY = -velY;
          }
          x += velX;
          y += velY;
          repaint();
      }   
  }
  </code></pre>
  
  <p>This class just simply draws the ball and provides the logic for the timer and such</p>
  
  <pre><code>import java.awt.Color;
  import javax.swing.JFrame;
  
  public class Gui {
  
      public static void main(String[] args)
      {
          move s = new move();
          JFrame f = new JFrame("move");
          f.add(s);
          f.setVisible(true);
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          f.setSize(1000, 1000);
          f.setTitle("Moving Circle");
          f.setBackground(Color.GREEN);
      }
  }
  </code></pre>
  
  <p>This next class just puts it all in a JFrame, very simple stuff I know but I'm just trying to draw multiple instances within the same JFrame. I'm just trying to experiment with my knowledge of code, some sample of code to implement would be great.</p>
  
  <p>How to draw multiple moving graphics?</p>