//******************************************************************** // DotsPanel.java Author: Lewis/Loftus // // Represents the primary panel for the Dots program. //******************************************************************** import java.util.ArrayList; import javax.swing.JPanel; import java.awt.*; import java.awt.event.*; public class DotsPanel extends JPanel { private final int SIZE = 6; // radius of each dot private ArrayList pointList; //----------------------------------------------------------------- // Constructor: Sets up this panel to listen for mouse events. //----------------------------------------------------------------- public DotsPanel() { pointList = new ArrayList(); addMouseListener (new DotsListener()); setBackground (Color.black); setPreferredSize (new Dimension(300, 200)); } //----------------------------------------------------------------- // Draws all of the dots stored in the list. //----------------------------------------------------------------- public void paintComponent (Graphics page) { super.paintComponent(page); page.setColor (Color.green); for (int i=0; i