import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; 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.JInternalFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; 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() { JInternalFrame frame = new JInternalFrame(); JMenuBar mb = new JMenuBar(); JMenu menu = new JMenu("Menu"); for (int i = 0; i < 5; ++i) { JMenuItem item = new JMenuItem("Item " + i); item.setMnemonic((char) + ('0' + i)); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println(e); } }); menu.add(item); } mb.add(menu); frame.setJMenuBar(mb); frame.show(); node.setContent(frame); } }); } public static void main(String[] args) { launch(args); } }