ActionEvent Class Assignment Help

Assignment Help: >> Event Sources - ActionEvent Class

ActionEvent Class:

An ActionEvent is produced whenever a button is pressed, a list item is double clicked, or a menu Item is chosen. The ActionEvent class declares four integer constants which could be used to identify any modifiers related with an action event:

ALT_MASK, CTRL_MASK,META_MASK,and SHIFT_MASK. Further,

there is an integer constant, ACTION_PERFORMED, that can be used to recognize 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. A type of the event is specified through Type, and its command string is cmd. The argument modifiers denote that modifiers keys (CTRL, ALT, SHIFT and/or META) were pressed when 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 that has a command name equal to the label on that button.

A getModifiers() method returns a value which denotes that modifier keys(ALT, CTRL, META, and/or SHIFT) were pressed whenever the event was produced. Its form is display here:

int getModifiers()

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd