/* * This class represents what we want to put on a Window. * For now we are just indicating that the class MouseHandler * will take care of Mouse events. */ import javax.swing.*; public class MyPanel extends JPanel { public MyPanel() { // We are specifying that the MouseHandler class we // define will take care of mouse events addMouseListener(new MouseHandler()); } }