Spec-Zone.ru › OpenJavaFX 24

Class WebEvent<T>

java.lang.Object
java.util.EventObject
javafx.event.Event
javafx.scene.web.WebEvent<T>
Type Parameters:
T - the type of the web event
All Implemented Interfaces:
Serializable, Cloneable
public final class WebEvent<T> extends Event
WebEvent instances are passed into EventHandlers registered with a WebEngine by JavaScript running on a Web page. An event holds a single data item of type T.
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

Modifier and Type Field Description
static final EventType<WebEvent> ALERT
This event occurs when a script calls the JavaScript alert function.
static final EventType<WebEvent> ANY
Common supertype for all Web event types.
static final EventType<WebEvent> RESIZED
This event occurs when a script changes location of the JavaScript window object.
static final EventType<WebEvent> STATUS_CHANGED
This event occurs when a script changes status line text.
static final EventType<WebEvent> VISIBILITY_CHANGED
This event occurs when a script changes visibility of the JavaScript window object.

Fields declared in class javafx.event.Event

consumed, eventType, NULL_SOURCE_TARGET, target

Fields declared in class java.util.EventObject

source

Constructor Summary

Constructor Description
WebEvent(Object source, EventType<WebEvent> type, T data)
Creates a new event object.

Method Summary

Modifier and Type Method Description
T getData()
Returns data item carried by this event.
String toString()
Returns a string representation of this WebEvent object.

Methods declared in class javafx.event.Event

clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed

Methods declared in class java.util.EventObject

getSource

Methods declared in class java.lang.Object

equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Details

ANY

public static final EventType<WebEvent> ANY
Common supertype for all Web event types.

RESIZED

public static final EventType<WebEvent> RESIZED
This event occurs when a script changes location of the JavaScript window object.

STATUS_CHANGED

public static final EventType<WebEvent> STATUS_CHANGED
This event occurs when a script changes status line text.

VISIBILITY_CHANGED

public static final EventType<WebEvent> VISIBILITY_CHANGED
This event occurs when a script changes visibility of the JavaScript window object.

ALERT

public static final EventType<WebEvent> ALERT
This event occurs when a script calls the JavaScript alert function.

Constructor Details

WebEvent

public WebEvent(Object source, EventType<WebEvent> type, T data)
Creates a new event object.
Parameters:
source - the event source
type - the event type
data - the data item

Method Details

getData

public T getData()
Returns data item carried by this event.
Returns:
the data item

toString

public String toString()
Returns a string representation of this WebEvent object.
Overrides:
toString in class EventObject
Returns:
a string representation of this WebEvent object.

Report a bug or suggest an enhancement
Copyright © 2008, 2025, Oracle and/or its affiliates. All rights reserved.

© 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.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API