java.awt.event
public class ActionEvent extends AWTEvent
Since: 1.1
See Also: ActionListener
UNKNOWN: updated to 1.4
Field Summary | |
---|---|
static int | ACTION_FIRST The first id number in the range of action id's. |
static int | ACTION_LAST The last id number in the range of action id's. |
static int | ACTION_PERFORMED An event id indicating that an action has occurred. |
static int | ALT_MASK Bit mask indicating that the alt key was pressed. |
static int | CTRL_MASK Bit mask indicating the control key was pressed. |
static int | META_MASK Bit mask indicating the that meta key was pressed. |
static int | SHIFT_MASK Bit mask indicating the shift key was pressed. |
Constructor Summary | |
---|---|
ActionEvent(Object source, int id, String command)
Initializes a new instance of ActionEvent with the
specified source, id, and command. | |
ActionEvent(Object source, int id, String command, int modifiers)
Initializes a new instance of ActionEvent with the
specified source, id, command, and modifiers. | |
ActionEvent(Object source, int id, String command, long when, int modifiers)
Initializes a new instance of ActionEvent with the
specified source, id, command, and modifiers, and timestamp. |
Method Summary | |
---|---|
String | getActionCommand()
Returns the command string associated with this action.
|
int | getModifiers()
Returns the keys held down during the action. |
long | getWhen()
Gets the timestamp of when this action took place. |
String | paramString()
Returns a string that identifies the action event. |
ActionEvent
with the
specified source, id, and command. Note that an invalid id leads to
unspecified results.
Parameters: source the event source id the event id command the command string for this action
Throws: IllegalArgumentException if source is null
ActionEvent
with the
specified source, id, command, and modifiers. Note that an invalid id
leads to unspecified results.
Parameters: source the event source id the event id command the command string for this action modifiers the bitwise or of modifier keys down during the action
Throws: IllegalArgumentException if source is null
ActionEvent
with the
specified source, id, command, and modifiers, and timestamp. Note that
an invalid id leads to unspecified results.
Parameters: source the event source id the event id command the command string for this action when the timestamp of the event modifiers the bitwise or of modifier keys down during the action
Throws: IllegalArgumentException if source is null
Since: 1.4
Returns: the command string associated with this action
Returns: the modifier bits
Returns: the timestamp of this action
Since: 1.4
"ACTION_PERFORMED,cmd=" + getActionCommand() + ",when=" + getWhen()
+ ",modifiers=" + <modifier string>
, where the modifier
string is in the order "Meta", "Ctrl", "Alt", "Shift", "Alt Graph", and
"Button1", separated by '+', according to the bits set in getModifiers().
Returns: a string identifying the event