Mouse Click
Click on the colored spot (disk or square) to alternate shapes and colors. Watch the message printed on the Java console
after each click.
The program has two classes:
- myApplet.java. The applet, which handles the painting and adds a MouseListener to handle mouse events.
- MouseHandler.java, which knows of the calling applet (via a parameter passed from
constructor) and handles one mouse event: when the mouse is released.