-
Enhancement
-
Resolution: Fixed
-
P3
-
8
As part of Swing/FX interoperability efforts, a new JavaFX node should be created to embed Swing content into JavaFX applications. Following is the proposed API:
public class SwingNode extends Node {
/**
* Attaches a {@code JComponent} instance to display in this {@code SwingNode}.
* <p>
* The method can be called either on the JavaFX Application thread or the Swing thread.
* Note however, that access to a Swing component must occur from the Swing thread according
* to the Swing threading restrictions.
*
* @param content a Swing component to display in this {@code SwingNode}
*
* @see java.awt.EventQueue#isDispatchThread()
* @see javafx.application.Platform#isFxApplicationThread()
*/
public void setContent(final JComponent content);
/**
* Returns the {@code JComponent} instance attached to this {@code SwingNode}.
* <p>
* The method can be called either on the JavaFX Application thread or the Swing thread.
* Note however, that access to a Swing component must occur from the Swing thread according
* to the Swing threading restrictions.
*
* @see java.awt.EventQueue#isDispatchThread()
* @see javafx.application.Platform#isFxApplicationThread()
*
* @return the Swing component attached to this {@code SwingNode}
*/
public JComponent getContent();
}
public class SwingNode extends Node {
/**
* Attaches a {@code JComponent} instance to display in this {@code SwingNode}.
* <p>
* The method can be called either on the JavaFX Application thread or the Swing thread.
* Note however, that access to a Swing component must occur from the Swing thread according
* to the Swing threading restrictions.
*
* @param content a Swing component to display in this {@code SwingNode}
*
* @see java.awt.EventQueue#isDispatchThread()
* @see javafx.application.Platform#isFxApplicationThread()
*/
public void setContent(final JComponent content);
/**
* Returns the {@code JComponent} instance attached to this {@code SwingNode}.
* <p>
* The method can be called either on the JavaFX Application thread or the Swing thread.
* Note however, that access to a Swing component must occur from the Swing thread according
* to the Swing threading restrictions.
*
* @see java.awt.EventQueue#isDispatchThread()
* @see javafx.application.Platform#isFxApplicationThread()
*
* @return the Swing component attached to this {@code SwingNode}
*/
public JComponent getContent();
}
- is blocked by
-
JDK-8098055 Swing components inside JavaFX
-
- Closed
-