List of usage examples for javafx.scene.control Menu setMnemonicParsing
public final void setMnemonicParsing(boolean value)
From source file:Main.java
@Override public void start(Stage primaryStage) { BorderPane root = new BorderPane(); Scene scene = new Scene(root, 300, 250, Color.WHITE); MenuBar menuBar = new MenuBar(); menuBar.prefWidthProperty().bind(primaryStage.widthProperty()); root.setTop(menuBar);/*from w w w . ja va2 s .com*/ Menu fileMenu = new Menu("_File"); fileMenu.setMnemonicParsing(true); MenuItem exitMenuItem = new MenuItem("Exit"); fileMenu.getItems().add(exitMenuItem); exitMenuItem.setOnAction(actionEvent -> Platform.exit()); menuBar.getMenus().addAll(fileMenu); primaryStage.setScene(scene); primaryStage.show(); }