ActionEvent (Java Platform SE 8 ) (original) (raw)


public class ActionEvent
extends AWTEvent
A semantic event which indicates that a component-defined action occurred. This high-level event is generated by a component (such as aButton) when the component-specific action occurs (such as being pressed). The event is passed to every ActionListener object that registered to receive such events using the component'saddActionListener method.
Note: To invoke an ActionEvent on aButton using the keyboard, use the Space bar.
The object that implements the ActionListener interface gets this ActionEvent when the event occurs. The listener is therefore spared the details of processing individual mouse movements and mouse clicks, and can instead process a "meaningful" (semantic) event like "button pressed".
An unspecified behavior will be caused if the id parameter of any particular ActionEvent instance is not in the range from ACTION_FIRST to ACTION_LAST.
Since:
1.1
See Also:
ActionListener, Tutorial: How to Write an Action Listener, Serialized Form

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.