- java.lang.Object
-
- java.util.EventObject
-
- javafx.event.Event
-
- javafx.scene.web.WebEvent<T>
-
- All Implemented Interfaces:
-
Serializable,Cloneable
public final class WebEvent<T> extends Event
WebEventinstances are passed intoEventHandlers registered with aWebEngineby JavaScript running on a Web page. An event holds a single data item of typeT.- Since:
- JavaFX 2.0
- See Also:
-
WebEngine,WebEngine.setOnAlert(javafx.event.EventHandler<javafx.scene.web.WebEvent<java.lang.String>>),WebEngine.setOnResized(javafx.event.EventHandler<javafx.scene.web.WebEvent<javafx.geometry.Rectangle2D>>),WebEngine.setOnStatusChanged(javafx.event.EventHandler<javafx.scene.web.WebEvent<java.lang.String>>),WebEngine.setOnVisibilityChanged(javafx.event.EventHandler<javafx.scene.web.WebEvent<java.lang.Boolean>>), Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static EventType<WebEvent>ALERTThis event occurs when a script calls the JavaScriptalertfunction.static EventType<WebEvent>ANYCommon supertype for all Web event types.static EventType<WebEvent>RESIZEDThis event occurs when a script changes location of the JavaScriptwindowobject.static EventType<WebEvent>STATUS_CHANGEDThis event occurs when a script changes status line text.static EventType<WebEvent>VISIBILITY_CHANGEDThis event occurs when a script changes visibility of the JavaScriptwindowobject.-
Fields inherited from class javafx.event.Event
consumed, eventType, NULL_SOURCE_TARGET, target
-
Fields inherited from class java.util.EventObject
source
-
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method Description TgetData()Returns data item carried by this event.StringtoString()Returns a string representation of thisWebEventobject.-
Methods inherited from class javafx.event.Event
clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed
-
Methods inherited from class java.util.EventObject
getSource
-
-
Field Detail
-
RESIZED
public static final EventType<WebEvent> RESIZED
This event occurs when a script changes location of the JavaScriptwindowobject.
-
STATUS_CHANGED
public static final EventType<WebEvent> STATUS_CHANGED
This event occurs when a script changes status line text.
-
-
Method Detail
-
getData
public T getData()
Returns data item carried by this event.- Returns:
- the data item
-
toString
public String toString()
Returns a string representation of thisWebEventobject.- Overrides:
-
toStringin classEventObject - Returns:
- a string representation of this
WebEventobject.
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.