15. SwingNode
• 「JavaFXの上にSwing」がOKに
• SwingコンポーネントをSwingNodeでく
るんでシーングラフに追加
Label label = new Label("This is an FX Label");
JButton button = new JButton("This is a JButton");
button.addActionListener(event -> {
Platform.runLater(() -> label.setText("Hello from Swing!"));
});
SwingNode swing = new SwingNode();
swing.setContent(button);
VBox box = new VBox(15, label, swing);