CSC 112
Ileana Streinu

12. Mouse Click with MouseListener

  1. Modify the applet so that the colored object is centered on the canvas.
  2. Modify the applet so that the colored object is changed to a square when the click in on the left half of the canvas, and to a disk when the click is on the right half of the canvas.
  3. When done, modify creatively this applet to include some of the functionality of the previous exercises. For example, instead of just one colored spot (circle), add one more. Clicking on each spot should switch its shape (from filled circle to filled square and vice-versa). You can also add some text and perhaps a button or so.