Example #1
0
  // -----------------------------------------------------------------
  //  Draws this panel by requesting that each circle draw itself.
  // -----------------------------------------------------------------
  public void paintComponent(Graphics page) {
    super.paintComponent(page);

    circle1.draw(page);
    circle2.draw(page);
    circle3.draw(page);
    circle4.draw(page);
    circle5.draw(page);
  }
  public void drawAll(Graphics g) {
    Circle currentCircle;

    for (int i = 0; i < circles.size(); i++) {
      currentCircle = (Circle) (circles.get(i));
      currentCircle.draw(g);
    }
  }