import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javafx.application.Application; import javafx.embed.swing.SwingNode; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class ClickTest extends Application { @Override public void start(Stage stage) { StackPane pane = new StackPane(); SwingNode swingNode = new SwingNode(); init(swingNode); pane.getChildren().add(swingNode); final Scene scene = new Scene(pane,300, 250); scene.setFill(null); stage.setScene(scene); stage.show(); } private void init(final SwingNode swingNode) { SwingUtilities.invokeLater(new Runnable() { public void run() { JPanel panel = new JPanel(); panel.setLayout(null); JButton comp = new JButton("OK"); comp.setBounds(20, 20, 100, 50); panel.add(comp); swingNode.setContent(panel); } }); } public static void main(String[] args) { launch(args); } }