import javafx.application.Application; import javafx.builders.*; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.control.TextArea; import javafx.stage.Stage; public class MenuFocusBugTest extends Application { @Override public void start(Stage stage) throws Exception { stage.setScene( SceneBuilder.create() .root(BorderPaneBuilder.create() .top(MenuBarBuilder.create() .menus(MenuBuilder.create() .items(MenuItemBuilder.create() .text("New") .onAction(new EventHandler() { public void handle(ActionEvent actionEvent) { } }) .build() ) .text("File") .build() ) .build() ) .center( new TextArea() ) .build() ) .build() ); stage.setVisible(true); } public static void main(String[] args) { Application.launch(MenuFocusBugTest.class, null); } }