Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of

The gist of the matter.

When constructed, an instance of this class can be registered as a mouse listener to the contentpane,...

because it defines five mouse methods.

In other words, it implements the MouseListener interface, where these 5 methods are declared.

When the contentpane is clicked, one of the methods called is mouseClicked.

As all mouse methods do, this receives a reference to a MouseEvent object as parameter, that contains the method isMetaDown.

This return a boolean true value if the click was on the mouse's right button (most platforms) or if there was an equivalent action .

The Strings strclicksitu and strpaint are set accordingly :

A request to have JPanel's paintComponent method executed as soon as possible.

When the paint method starts, it draws the strpaint String at 10 pixels from the left side of the contentpane and 20 pixels from its top.




In a similar manner you can call these methods, that pretty much speak for themselves.


An anonymous JPanel subclass ...

set as contentpane.


Curly brackets, delimiting the class definition.