public Node getContent(Scene scene) { // TabPane final TabPane tabPane = new TabPane(); tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE); tabPane.setPrefWidth(scene.getWidth()); tabPane.setPrefHeight(scene.getHeight()); tabPane.prefWidthProperty().bind(scene.widthProperty()); tabPane.prefHeightProperty().bind(scene.heightProperty()); // list view examples Tab listViewTab = new Tab("ListView"); buildListViewTab(listViewTab); tabPane.getTabs().add(listViewTab); // tree view examples Tab treeViewTab = new Tab("TreeView"); buildTreeViewTab(treeViewTab); tabPane.getTabs().add(treeViewTab); // table view examples Tab tableViewTab = new Tab("TableView"); buildTableViewTab(tableViewTab); tabPane.getTabs().add(tableViewTab); return tabPane; }
/** * setup the xyTabPane and it's behavior */ public void setupXyTabPane() { // add the xyTabPane getRoot().getChildren().add(xyTabPane); // make sure it shrinks and grows with the scene NumberBinding heightAdjust = getStage().heightProperty() .add(menuBar.heightProperty()); xyTabPane.getvTabPane().prefHeightProperty() .bind(heightAdjust.add(-xyTabPane.getTabSize())); xyTabPane.getvTabPane().prefWidthProperty() .bind(getStage().widthProperty().add(0)); // -xyTabPane.getTabSize() }