Processing Mouse Events:
An ActionEvent is produced whenever a button is pressed, list item is double-clicked and a menu item is selected. An ActionEvent class declares four integer constants which could be used to identify any modifiers related along with an action event:
ALT_MASK, CTRL_MASK, META_MASK and SHIFT_MASK. In addition, there is an integer constant, ACTION_PERFORMED, that can be used to identify action events.
ActionEvent has these two constructors:
ActionEvent(Object src, int type, String cmd)
ActionEvent(Object src, int type, String cmd, int modifiers)
Above, src is a reference to the object which produced this event. The type of the event is particular through Type, and its command string is cmd. An argument modifier denotes that modifiers keys (SHIFT, META, CTRL, and/or ALT) were pressed whenever the event was produced.
You could acquire the command name for the invoking ActionEvent Object through using the getActionCommand() method, displays here:
String getActionCommand()
For instance, when a button is pressed, an action event is produced which has a command name equal to the label on that button.
A getModifiers() method returns a value that denotes that modifier keys(ALT, CTRL, META, and/or SHIFT) were pressed when the event was produced. Its form is displays here:
Int getModifiers()