Module javafx.web

Class WebEvent<T>

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 Details

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