package sample; import javafx.application.Application; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; import javafx.stage.WindowEvent; public class BrokenJFXApp extends Application { private TabPane tabPane = new TabPane(); private Tab tab1; private Tab tab2; private Tab tab3; public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { stage.setOnHidden(new EventHandler() { @Override public void handle(WindowEvent event) { System.exit(0); } }); stage.setTitle("UniBoard"); final BorderPane root = new BorderPane(); root.setId("root"); tab1 = new Tab("Tab 1"); tab1.setClosable(false); tab1.setContent(new Label("Tab 1")); tabPane.getTabs().add(tab1); tab2 = new Tab("Tab 2"); tab2.setClosable(false); tab2.setContent(new Label("Tab 2")); tabPane.getTabs().add(tab2); tab3 = new Tab("Tab 3"); tab3.setClosable(false); tab3.setContent(new Label("Tab 3")); tabPane.getTabs().add(tab3); root.setCenter(tabPane); final Scene scene = new Scene(root, 500, 500); stage.setScene(scene); stage.sizeToScene(); stage.show(); } }