public class ActionEvent extends Event
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.Modifier and Type | Field and Description |
---|---|
static EventType<ActionEvent> |
ACTION
The only valid EventType for the ActionEvent.
|
static EventType<ActionEvent> |
ANY
Common supertype for all action event types.
|
consumed, eventType, NULL_SOURCE_TARGET, target
source
Constructor and Description |
---|
ActionEvent()
Creates a new
ActionEvent with an event type of ACTION . |
ActionEvent(Object source,
EventTarget target)
Construct a new
ActionEvent with the specified event source and target. |
Modifier and Type | Method and Description |
---|---|
ActionEvent |
copyFor(Object newSource,
EventTarget newTarget)
Creates and returns a copy of this event with the specified event source
and target.
|
EventType<? extends ActionEvent> |
getEventType()
Gets the event type of this event.
|
getSource, toString
public static final EventType<ActionEvent> ACTION
public static final EventType<ActionEvent> ANY
public ActionEvent()
ActionEvent
with an event type of ACTION
.
The source and target of the event is set to NULL_SOURCE_TARGET
.public ActionEvent(Object source, EventTarget target)
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
.source
- the event source which sent the eventtarget
- the event target to associate with the eventpublic ActionEvent copyFor(Object newSource, EventTarget newTarget)
Event
null
, it is
replaced by the NULL_SOURCE_TARGET
value.public EventType<? extends ActionEvent> getEventType()
Event
Event
class can have different event types. These event types further specify
what kind of event occurred.getEventType
in class Event
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 © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.