- Actionevent в java это
- Field Summary
- Fields inherited from class javafx.event.Event
- Fields inherited from class java.util.EventObject
- Constructor Summary
- Method Summary
- Methods inherited from class javafx.event.Event
- Methods inherited from class java.util.EventObject
- Methods inherited from class java.lang.Object
- Field Detail
- ACTION
- ANY
- Constructor Detail
- ActionEvent
- ActionEvent
- Method Detail
- copyFor
- getEventType
- Actionevent в java это
- Field Summary
- Fields inherited from class java.awt.AWTEvent
- Fields inherited from class java.util.EventObject
- Constructor Summary
- Method Summary
- Methods inherited from class java.awt.AWTEvent
- Methods inherited from class java.util.EventObject
- Methods inherited from class java.lang.Object
- Field Detail
- SHIFT_MASK
- CTRL_MASK
- META_MASK
- ALT_MASK
- ACTION_FIRST
- ACTION_LAST
- ACTION_PERFORMED
- Constructor Detail
- ActionEvent
- ActionEvent
- ActionEvent
- Method Detail
- getActionCommand
- getWhen
- getModifiers
- paramString
- Actionevent в java это
- Field Summary
- Fields declared in class java.awt.AWTEvent
- Fields declared in class java.util.EventObject
- Constructor Summary
- Method Summary
- Methods declared in class java.awt.AWTEvent
- Methods declared in class java.util.EventObject
- Methods declared in class java.lang.Object
- Field Detail
- SHIFT_MASK
- CTRL_MASK
- META_MASK
- ALT_MASK
- ACTION_FIRST
- ACTION_LAST
- ACTION_PERFORMED
- Constructor Detail
- ActionEvent
- ActionEvent
- ActionEvent
- Method Detail
- getActionCommand
- getWhen
- getModifiers
- paramString
- AWT ActionEvent Class
- Class declaration
- Field
- Class constructors
- Class methods
- Methods inherited
Actionevent в java это
An Event representing some type of action. This event type is widely used to represent a variety of things, such as when a Button has been fired, when a KeyFrame has finished, and other such usages.
Field Summary
Fields inherited from class javafx.event.Event
Fields inherited from class java.util.EventObject
Constructor Summary
Method Summary
Methods inherited from class javafx.event.Event
Methods inherited from class java.util.EventObject
Methods inherited from class java.lang.Object
Field Detail
ACTION
ANY
Constructor Detail
ActionEvent
Creates a new ActionEvent with an event type of ACTION . The source and target of the event is set to NULL_SOURCE_TARGET .
ActionEvent
public ActionEvent(Object source, EventTarget target)
Construct a new ActionEvent with the specified event source and target. If the source or target is set to null , it is replaced by the NULL_SOURCE_TARGET value. All ActionEvents have their type set to ACTION .
Method Detail
copyFor
public ActionEvent copyFor(Object newSource, EventTarget newTarget)
Creates and returns a copy of this event with the specified event source and target. If the source or target is set to null , it is replaced by the NULL_SOURCE_TARGET value.
getEventType
Gets the event type of this event. Objects of the same Event class can have different event types. These event types further specify what kind of event occurred.
Actionevent в java это
A semantic event which indicates that a component-defined action occurred. This high-level event is generated by a component (such as a Button ) 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’s addActionListener method. Note: To invoke an ActionEvent on a Button 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 .
Field Summary
Fields inherited from class java.awt.AWTEvent
Fields inherited from class java.util.EventObject
Constructor Summary
Method Summary
Methods inherited from class java.awt.AWTEvent
Methods inherited from class java.util.EventObject
Methods inherited from class java.lang.Object
Field Detail
SHIFT_MASK
public static final int SHIFT_MASK
CTRL_MASK
public static final int CTRL_MASK
META_MASK
public static final int META_MASK
ALT_MASK
public static final int ALT_MASK
ACTION_FIRST
public static final int ACTION_FIRST
ACTION_LAST
public static final int ACTION_LAST
ACTION_PERFORMED
@Native public static final int ACTION_PERFORMED
Constructor Detail
ActionEvent
public ActionEvent(Object source, int id, String command)
Constructs an ActionEvent object. This method throws an IllegalArgumentException if source is null . A null command string is legal, but not recommended.
ActionEvent
public ActionEvent(Object source, int id, String command, int modifiers)
Constructs an ActionEvent object with modifier keys. This method throws an IllegalArgumentException if source is null . A null command string is legal, but not recommended.
ActionEvent
public ActionEvent(Object source, int id, String command, long when, int modifiers)
Constructs an ActionEvent object with the specified modifier keys and timestamp. This method throws an IllegalArgumentException if source is null . A null command string is legal, but not recommended.
Method Detail
getActionCommand
Returns the command string associated with this action. This string allows a «modal» component to specify one of several commands, depending on its state. For example, a single button might toggle between «show details» and «hide details». The source object and the event would be the same in each case, but the command string would identify the intended action. Note that if a null command string was passed to the constructor for this ActionEvent , this this method returns null .
getWhen
Returns the timestamp of when this event occurred. Because an ActionEvent is a high-level, semantic event, the timestamp is typically the same as an underlying InputEvent.
getModifiers
paramString
Returns a parameter string identifying this action event. This method is useful for event-logging and for debugging.
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, 2023, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Actionevent в java это
A semantic event which indicates that a component-defined action occurred. This high-level event is generated by a component (such as a Button ) 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’s addActionListener method. Note: To invoke an ActionEvent on a Button 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 .
Field Summary
Fields declared in class java.awt.AWTEvent
Fields declared in class java.util.EventObject
Constructor Summary
Method Summary
Methods declared in class java.awt.AWTEvent
Methods declared in class java.util.EventObject
Methods declared in class java.lang.Object
Field Detail
SHIFT_MASK
public static final int SHIFT_MASK
CTRL_MASK
public static final int CTRL_MASK
META_MASK
public static final int META_MASK
ALT_MASK
public static final int ALT_MASK
ACTION_FIRST
public static final int ACTION_FIRST
ACTION_LAST
public static final int ACTION_LAST
ACTION_PERFORMED
@Native public static final int ACTION_PERFORMED
Constructor Detail
ActionEvent
public ActionEvent(Object source, int id, String command)
Constructs an ActionEvent object. This method throws an IllegalArgumentException if source is null . A null command string is legal, but not recommended.
ActionEvent
public ActionEvent(Object source, int id, String command, int modifiers)
Constructs an ActionEvent object with modifier keys. This method throws an IllegalArgumentException if source is null . A null command string is legal, but not recommended.
ActionEvent
public ActionEvent(Object source, int id, String command, long when, int modifiers)
Constructs an ActionEvent object with the specified modifier keys and timestamp. This method throws an IllegalArgumentException if source is null . A null command string is legal, but not recommended.
Method Detail
getActionCommand
Returns the command string associated with this action. This string allows a «modal» component to specify one of several commands, depending on its state. For example, a single button might toggle between «show details» and «hide details». The source object and the event would be the same in each case, but the command string would identify the intended action. Note that if a null command string was passed to the constructor for this ActionEvent , this this method returns null .
getWhen
Returns the timestamp of when this event occurred. Because an ActionEvent is a high-level, semantic event, the timestamp is typically the same as an underlying InputEvent.
getModifiers
paramString
Returns a parameter string identifying this action event. This method is useful for event-logging and for debugging.
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
AWT ActionEvent Class
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.
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.
- 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.
Class 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.
Class methods
java.lang.String getActionCommand()
Returns the command string associated with this action.
Returns the modifier keys held down during this action event.
Returns the timestamp of when this event occurred.
java.lang.String paramString()
Returns a parameter string identifying this action event.
Methods inherited
This class inherits methods from the following classes: