import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javafx.application.Application; import javafx.embed.swing.SwingNode; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.stage.Stage; import javax.swing.JComboBox; import javax.swing.JPanel; import javax.swing.SwingUtilities; /** * * @author aeremeev */ public class FXTest extends Application { @Override public void start(final Stage stage) throws Exception { Pane pane = new StackPane(); Scene scene = new Scene(pane, 200, 200); final SwingNode swingNode = new SwingNode(); init(swingNode); pane.getChildren().addAll(swingNode); stage.setScene(scene); stage.show(); } private void init(final SwingNode node) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JPanel panel = new JPanel(); JComboBox component = new JComboBox<>(); for (int i = 0; i < 10; ++i) { component.addItem("Item " + i); } component.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { System.out.println(e); } }); panel.add(component); node.setContent(panel); } }); } public static void main(String[] args) { launch(args); } }