package test; import javafx.application.Application; import javafx.event.Event; import javafx.event.EventHandler; 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 MenuBug extends Application { @Override public void start(Stage primaryStage) { BorderPane p = new BorderPane(); MenuBar b = new MenuBar(); p.setTop(b); Menu m = new Menu("Test"); m.setOnShowing(new EventHandler() { @Override public void handle(Event event) { System.err.println("On showing called"); } }); m.getItems().add(new MenuItem("T1")); b.getMenus().add(m); primaryStage.setScene(new Scene(p)); primaryStage.setWidth(200); primaryStage.setHeight(200); primaryStage.show(); } public static void main(String[] args) { launch(args); } }