Package xdev.ui

Class XdevJFXPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javafx.embed.swing.JFXPanel
xdev.ui.XdevJFXPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
XdevBrowser

public class XdevJFXPanel extends javafx.embed.swing.JFXPanel
A component to embed JavaFX content into Swing applications. The content to be displayed is specified with the setScene(javafx.scene.Scene) method that accepts an instance of JavaFX Scene. After the scene is assigned, it gets repainted automatically. All the input and focus events are forwarded to the scene transparently to the developer.

There are some restrictions related to this component. As a Swing component, it should only be accessed from the event dispatch thread, except the setScene(javafx.scene.Scene) method, which can be called either on the event dispatch thread or on the JavaFX application thread.

Since:
5.0
Author:
XDEV Software
See Also:
  • Constructor Details

    • XdevJFXPanel

      public XdevJFXPanel()
      Creates a new XdevJFXPanel object.

      Implementation note: when the first XdevJFXPanel object is created, it implicitly initializes the JavaFX runtime. This is the preferred way to initialize JavaFX in Swing.

  • Method Details

    • setScene

      public void setScene(javafx.scene.Scene newScene)
      Attaches a Scene object to display in this XdevJFXPanel. This method can be called either on the event dispatch thread or the JavaFX application thread.
      Overrides:
      setScene in class javafx.embed.swing.JFXPanel
      Parameters:
      newScene - a scene to display in this XdevJFXpanel