SwingNode is a javafx scene node and can be added to any javafx layout .
To add a JPanel to a panel and display it in the JavaFX step:
- Add JPanel to SwingNode
- Assign the swingnode as a child of any of the layouts (including the panel).
- Set the layout as the scene root
- Set the scene on the scene and display it
A very simple code example to show how you can add it to a panel (from SwingNode Javadoc ):
public class SwingNodeExample extends Application { @Override public void start(Stage stage) { final SwingNode swingNode = new SwingNode(); createAndSetSwingContent(swingNode); Pane pane = new Pane(); pane.getChildren().add(swingNode);
Itachi uchiha
source share