public class WindowEvent extends Event
Modifier and Type | Field and Description |
---|---|
static EventType<WindowEvent> |
ANY
Common supertype for all window event types.
|
static EventType<WindowEvent> |
WINDOW_CLOSE_REQUEST
This event is delivered to a
window when there is an external request to close that window.
|
static EventType<WindowEvent> |
WINDOW_HIDDEN
This event occurs on window just after it is hidden.
|
static EventType<WindowEvent> |
WINDOW_HIDING
This event occurs on window just before it is hidden.
|
static EventType<WindowEvent> |
WINDOW_SHOWING
This event occurs on window just before it is shown.
|
static EventType<WindowEvent> |
WINDOW_SHOWN
This event occurs on window just after it is shown.
|
consumed, eventType, NULL_SOURCE_TARGET, target
source
Constructor and Description |
---|
WindowEvent(Window source,
EventType<? extends Event> eventType)
Construct a new
Event with the specified event source, target
and type. |
Modifier and Type | Method and Description |
---|---|
WindowEvent |
copyFor(Object newSource,
EventTarget newTarget)
Creates and returns a copy of this event with the specified event source
and target.
|
WindowEvent |
copyFor(Object newSource,
EventTarget newTarget,
EventType<WindowEvent> type)
Creates a copy of the given event with the given fields substituted.
|
EventType<WindowEvent> |
getEventType()
Gets the event type of this event.
|
String |
toString()
Returns a string representation of this
WindowEvent object. |
getSource
public static final EventType<WindowEvent> ANY
public static final EventType<WindowEvent> WINDOW_SHOWING
public static final EventType<WindowEvent> WINDOW_SHOWN
public static final EventType<WindowEvent> WINDOW_HIDING
public static final EventType<WindowEvent> WINDOW_HIDDEN
public static final EventType<WindowEvent> WINDOW_CLOSE_REQUEST
public WindowEvent(Window source, EventType<? extends Event> eventType)
Event
with the specified event source, target
and type. If the source or target is set to null
, it is replaced
by the NULL_SOURCE_TARGET
value.source
- the event source which sent the eventeventType
- the event typepublic String toString()
WindowEvent
object.toString
in class EventObject
WindowEvent
object.public WindowEvent copyFor(Object newSource, EventTarget newTarget)
Event
null
, it is
replaced by the NULL_SOURCE_TARGET
value.public WindowEvent copyFor(Object newSource, EventTarget newTarget, EventType<WindowEvent> type)
source
- the new source of the copied eventtarget
- the new target of the copied eventeventType
- the new eventTypepublic EventType<WindowEvent> 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.