@@ -0,0 +1,1641 @@
+package circlePractice;%0A%0Aimport java.awt.Color;%0Aimport java.awt.Component;%0Aimport java.awt.Dimension;%0Aimport java.awt.Graphics;%0Aimport java.util.ArrayList;%0Aimport javax.swing.JPanel;%0A%0Apublic class Canvas extends JPanel %7B%0A%0A%09private static final long serialVersionUID = 1L;%0A%09ArrayList%3CCircle%3E circle;%0A%09ControlPanel panel;%0A%09Color%5B%5D color;%0A%0A%09public Canvas() %7B%0A%09%09circle = new ArrayList%3CCircle%3E();%0A%09%09this.setSize(new Dimension(400, 400));%0A%09%7D%0A%0A%09public Canvas(int N) %7B%0A%0A%09%09this();%0A%0A%09%09for (int i = 0; i %3C N; i++) %7B%0A%09%09%09addRed();%0A%09%09%09addBlue();%0A%09%09%7D%0A%09%7D%0A%0A%09public void update() %7B%0A%09%09repaint();%0A%09%09for (Circle circles : circle) %7B%0A%09%09%09System.out.println(circles);%0A%09%09%7D%0A%09%7D%0A%0A%09public void addRed() %7B%0A%09%09Circle r = new Circle(randomPos(), randomPos(), randomRadius());%0A%09%09r.ColorRed();%0A%09%09circle.add(r);%0A%09%09update();%0A%09%7D%0A%0A%09private int randomRadius() %7B%0A%09%09return (int) (Math.random() * 200);%0A%09%7D%0A%0A%09private int randomPos() %7B%0A%09%09return (int) (Math.random() * 20) + 10;%0A%09%7D%0A%0A%09public void addBlue() %7B%0A%09%09Circle r = new Circle(randomPos(), randomPos(), randomRadius());%0A%09%09r.ColorBlue();%0A%09%09circle.add(r);%0A%09%09update();%0A%09%7D%0A%0A%09public void addBlack() %7B%0A%09%09Circle r = new Circle(randomPos(), randomPos(), randomRadius());%0A%09%09r.ColorBlue();%0A%09%09circle.add(r);%0A%09%09update();%0A%09%7D%0A%0A%09public void addGreen() %7B%0A%09%09Circle r = new Circle(randomPos(), randomPos(), randomRadius());%0A%09%09r.ColorGreen();%0A%09%09circle.add(r);%0A%09%09update();%0A%0A%09%7D%0A%0A%09protected void paintComponent(Graphics pen) %7B%0A%09%09super.paintComponent(pen);%0A%0A%09%09for (Circle circles : circle) %7B%0A%09%09%09pen.setColor(circles.color);%0A%09%09%09pen.fillOval(circles.x, circles.y, circles.r, circles.r);%0A%09%09%7D%0A%09%7D%0A%0A%09public void addClear() %7B%0A%09%09circle.clear();%0A%09%09update();%0A%0A%09%7D%0A%0A%7D%0A

Create Canvas.java