This class is defined in java.awt.event package. The ActionEvent is generated when button is clicked or the item of a list is double clicked.

类声明

Following is the declaration for java.awt.event.ActionEvent class:

  1. public class ActionEvent
  2. extends AWTEvent

Field

Following are the fields for java.awt.event.ActionEvent class:

  • static int ACTION_FIRST — The first number in the range of ids used for action events.

  • static int ACTION_LAST — The last number in the range of ids used for action events.

  • static int ACTION_PERFORMED — This event id indicates that a meaningful action occured.

  • static int ALT_MASK — The alt modifier.

  • static int CTRL_MASK — The control modifier.

  • static int META_MASK — The meta modifier.

  • static int SHIFT_MASK — The shift modifier.

类的构造函数

S.N.Constructor & Description
1ActionEvent(java.lang.Object source, int id, java.lang.String command)Constructs an ActionEvent object.
2ActionEvent(java.lang.Object source, int id, java.lang.String command, int modifiers)Constructs an ActionEvent object with modifier keys.
3ActionEvent(java.lang.Object source, int id, java.lang.String command, long when, int modifiers)Constructs an ActionEvent object with the specified modifier keys and timestamp.

类方法

S.N.Method & Description
1java.lang.String getActionCommand()Returns the command string associated with this action.
2int getModifiers()Returns the modifier keys held down during this action event.
3long getWhen()Returns the timestamp of when this event occurred.
4java.lang.String paramString()Returns a parameter string identifying this action event.

方法继承

This class inherits methods from the following classes:

  • java.awt.AWTEvent

  • java.util.EventObject

  • java.lang.Object