AWT ActionEvent Class

  • Post author:
  • Post category:AWT
  • Post comments:0 Comments
ActionEvent class

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

Class declaration

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

public class ActionEvent
   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.
  • a 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.
  • a static int META_MASK — The meta modifier.
  • a static int SHIFT_MASK — The shift modifier.

Class constructors

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.

Class methods

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.

Methods inherited

This class inherits methods from the following classes:

  • java.awt.AWTEvent
  • java.util.EventObject
  • java.lang.Object

Previous Page:-Click Here

Leave a Reply