APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.stage

public Class WindowEvent

extends Event
Class Inheritance
Imports
javafx.beans.NamedArg, javafx.event.Event, .EventTarget, .EventType

Event related to window showing/hiding actions.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
public static final EventType<WindowEvent>
ANY

Hides javafx.event.Event.ANY.

Common supertype for all window event types.
private static final long
public static final EventType<WindowEvent>
WINDOW_CLOSE_REQUEST

This event is delivered to a window when there is an external request to close that window.

public static final EventType<WindowEvent>
WINDOW_HIDDEN

This event occurs on window just after it is hidden.

public static final EventType<WindowEvent>
WINDOW_HIDING

This event occurs on window just before it is hidden.

public static final EventType<WindowEvent>
WINDOW_SHOWING

This event occurs on window just before it is shown.

public static final EventType<WindowEvent>
WINDOW_SHOWN

This event occurs on window just after it is shown.

Inherited from javafx.event.Event:
consumedeventTypeNULL_SOURCE_TARGETtarget

Constructor Summary

AccessConstructor and Description
public
WindowEvent(final Window
the event source which sent the event
source
,
final EventType<? extends Event>
the event type
eventType
)

Construct a new Event with the specified event source, target and type.

Method Summary

Modifier and TypeMethod and Description
public WindowEvent
copyFor(Object newSource, EventTarget newTarget)

Overrides javafx.event.Event.copyFor.

Creates and returns a copy of this event with the specified event source and target.

public WindowEvent

Returns:

the event copy with the fields substituted
copyFor
(Object
the new source of the copied event
newSource
,
EventTarget
the new target of the copied event
newTarget
,
EventType<WindowEvent>
the new eventType
type
)

Creates a copy of the given event with the given fields substituted.

public EventType<WindowEvent>
getEventType()

Overrides javafx.event.Event.getEventType.

Gets the event type of this event.

public String

Returns:

a string representation of this WindowEvent object.
toString
()

Overrides java.util.EventObject.toString.

Returns a string representation of this WindowEvent object.

Inherited from javafx.event.Event:
cloneconsumefireEventgetTargetisConsumed

Field Detail

ANYback to summary
public static final EventType<WindowEvent> ANY

Hides javafx.event.Event.ANY.

Common supertype for all window event types.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javafx.event.Event.serialVersionUID.

WINDOW_CLOSE_REQUESTback to summary
public static final EventType<WindowEvent> WINDOW_CLOSE_REQUEST

This event is delivered to a window when there is an external request to close that window. If the event is not consumed by any installed window event handler, the default handler for this event closes the corresponding window.

WINDOW_HIDDENback to summary
public static final EventType<WindowEvent> WINDOW_HIDDEN

This event occurs on window just after it is hidden.

WINDOW_HIDINGback to summary
public static final EventType<WindowEvent> WINDOW_HIDING

This event occurs on window just before it is hidden.

WINDOW_SHOWINGback to summary
public static final EventType<WindowEvent> WINDOW_SHOWING

This event occurs on window just before it is shown.

WINDOW_SHOWNback to summary
public static final EventType<WindowEvent> WINDOW_SHOWN

This event occurs on window just after it is shown.

Constructor Detail

WindowEventback to summary
public WindowEvent(final Window source, final EventType<? extends Event> eventType)

Construct a new 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.

Parameters
source:Window

the event source which sent the event

eventType:EventType<? extends Event>

the event type

Method Detail

copyForback to summary
public WindowEvent copyFor(Object newSource, EventTarget newTarget)

Overrides javafx.event.Event.copyFor.

Doc from javafx.event.Event.copyFor.

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.

Annotations
@Override
copyForback to summary
public WindowEvent copyFor(Object newSource, EventTarget newTarget, EventType<WindowEvent> type)

Creates a copy of the given event with the given fields substituted.

Parameters
newSource:Object

the new source of the copied event

newTarget:EventTarget

the new target of the copied event

type:EventType<WindowEvent>

the new eventType

Returns:WindowEvent

the event copy with the fields substituted

Since
JavaFX 8.0
getEventTypeback to summary
public EventType<WindowEvent> getEventType()

Overrides javafx.event.Event.getEventType.

Doc from javafx.event.Event.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.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.util.EventObject.toString.

Returns a string representation of this WindowEvent object.

Returns:String

a string representation of this WindowEvent object.

Annotations
@Override