import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Menu; import javafx.scene.control.MenuBar; import javafx.scene.control.MenuItem; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; public class App extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { MenuBar menuBar = new MenuBar(); Menu helpMenu = new Menu("Segítség"); MenuItem contentMenuItem = new MenuItem("Tartalom"); MenuItem aboutMenuItem = new MenuItem("Névjegy"); contentMenuItem.setOnAction(e->System.out.println("Tartalom")); aboutMenuItem.setOnAction(e->System.out.println("Névjegy")); helpMenu.getItems().addAll(contentMenuItem, aboutMenuItem); menuBar.getMenus().addAll(helpMenu); BorderPane borderPane = new BorderPane(); borderPane.setTop(menuBar); Scene scene = new Scene(borderPane, 300, 250); primaryStage.setScene(scene); primaryStage.show(); } }