Mouse Input requires us to implement a Java Interface. To fully understand this we would need to understand Inheritance. We can, however, follow enough of a few examples to be able to copy the needed code to implement mouse input in our own programs, as shown in the following examples:
The above projects are part of the UsingMouse BlueJ project that uses Canvas.java, Square.java, and Circle.java. Of these only the Canvas class has an additional method (to register mouse events with the display frame) from what we've seen before in these classes. Download all of these together in UsingMouse.zip