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 { Menu fileMenu = new Menu("Segítség"); fileMenu.getItems().add(new MenuItem("Tartalom")); fileMenu.getItems().add(new MenuItem("Névjegy")); MenuBar menuBar = new MenuBar(); menuBar.getMenus().addAll(fileMenu); BorderPane borderPane = new BorderPane(); borderPane.setTop(menuBar); Scene scene = new Scene(borderPane, 300, 250); primaryStage.setScene(scene); primaryStage.show(); } }