SWING: ActionEvent Class Cheat Sheet

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.
  • static int ACTION_PERFORMED − This event ID indicates that a meaningful action has occurred.
  • 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.
# Constructors
ActionEvent(java.lang.Object source, int id, java.lang.String command)Constructs an ActionEvent object.
ActionEvent(java.lang.Object source, int id, java.lang.String command, int modifiers)Constructs an ActionEvent object with modifier keys.
ActionEvent(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.
# Methods
java.lang.String getActionCommand()Returns the command string associated with this action.
int getModifiers()Returns the modifier keys held down during this action event.
long getWhen()Returns the timestamp of when this event occurred.
java.lang.String paramString()Returns a parameter string identifying this action event.
# Methods Inherited
  • java.awt.AWTEvent
  • java.util.EventObject
  • java.lang.Object

Leave a Reply

Your email address will not be published. Required fields are marked *