@@ -0,0 +1,2094 @@
+package circlePractice;%0A%0Aimport java.awt.event.ActionEvent;%0Aimport java.awt.event.ActionListener;%0Aimport java.util.Random;%0A%0Aimport javax.swing.JButton;%0Aimport javax.swing.JPanel;%0Aimport javax.swing.JTextField;%0A%0Apublic class ControlPanel extends JPanel %7B%0A%0A%09private static final long serialVersionUID = 1L;%0A%09private JButton redButton;%0A%09private JButton blueButton;%0A%09private JButton clearButton;%0A%09private Canvas canvasRef;%0A%09private JTextField textfield;%0A%09%0A%09public void setCanvas(Canvas canvasRef) %7B%0A%09%09this.canvasRef = canvasRef;%0A%09%7D%0A%0A%09public ControlPanel() %7B%0A%09%09redButton = new JButton(%22green%22);%0A%09%09redButton.addActionListener(new redAction());%0A%0A%09%09blueButton = new JButton(%22Random%22);%0A%09%09blueButton.addActionListener(new randomAction());%0A%0A%09%09clearButton = new JButton(%22clear%22);%0A%09%09clearButton.addActionListener(new clearButton());%0A%0A%09%09textfield = new JTextField(%22Enter the number of circles you want.%22);%0A%0A%09%09add(textfield);%0A%0A%09%09add(redButton);%0A%09%09add(blueButton);%0A%09%09// add( clearButton );%0A%0A%09%7D%0A%0A%09class redAction implements ActionListener %7B%0A%09%09public void actionPerformed(ActionEvent arg0) %7B%0A%09%09%09System.out.println(%22green button%22);%0A%09%09%09int msg = Integer.parseInt(textfield.getText());%0A%09%09%09for (int i = 0; i %3C msg; i++) %7B%0A%09%09%09%09canvasRef.addGreen();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09/*%0A%09 * private int randomRadius() %7B return (int)(Math.random()*4); %7D%0A%09 */%0A%09class randomAction implements ActionListener %7B%0A%0A%09%09public void actionPerformed(ActionEvent arg0) %7B%0A%09%09%09int x = (int) (Math.random() * 2) ;%0A%09%09%09System.out.println(%22Random button%22);%0A%09%09%09int msg = Integer.parseInt(textfield.getText());%0A%09%09%09for (int i = 0; i %3C msg; i++) %7B%0A%09%09%09%09System.out.println(x);%0A%09%09%09%09if(x == 0)%7B%0A%09%09%09%09canvasRef.addBlue();%0A%09%09%09%09x++;%0A%09%09%09%09%7D%0A%09%09%09%09else if(x == 1)%7B%0A%09%09%09%09canvasRef.addBlack();%0A%09%09%09%09x++;%0A%09%09%09%09%7D%0A%09%09%09%09else if(x == 2)%7B%0A                canvasRef.addRed();%0A                x++;%0A%09%09%09%09%7D%0A%09%09%09%09else%7B%0A                canvasRef.addGreen();%09%0A                break;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09class clearButton implements ActionListener %7B%0A%0A%09%09@Override%0A%09%09public void actionPerformed(ActionEvent arg0) %7B%0A%09%09%09System.out.println(%22clearing all.. wait..%22);%0A%09%09%09canvasRef.addClear();%0A%0A%09%09%7D%0A%0A%09%7D%0A%0A%7D%0A

Create ControlPanel.java