import javafx.application.Application; import javafx.geometry.Side; import javafx.scene.Scene; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.layout.TilePane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class TabPaneTest3 extends Application { TabPane[] tps = null; public void start(Stage stage) throws Exception { TilePane pane = new TilePane(10, 10); pane.setPrefColumns(2); tps = new TabPane[4]; CreateTP(0, "T"); CreateTP(1, "R"); CreateTP(2, "B"); CreateTP(3, "L"); tps[0].setSide(Side.TOP); tps[1].setSide(Side.RIGHT); tps[2].setSide(Side.BOTTOM); tps[3].setSide(Side.LEFT); pane.getChildren().addAll(tps); Scene scene = new Scene(pane, 500, 500); stage.setScene(scene); stage.setTitle("TabPaneTest3"); stage.show(); } // start private void CreateTP(int i, String s) { TabPane tp = new TabPane(); Tab tab1 = new Tab(s + " tab 1"); tab1.setContent(new Rectangle(200, 200, Color.RED)); tp.getTabs().add(tab1); Tab tab2 = new Tab(s + " tab 2"); tab2.setContent(new Rectangle(200, 200, Color.BLUE)); tp.getTabs().add(tab2); tp.setStyle("-fx-border-color: black; -fx-border-width: 1"); /* // try with and without this block ... tp.setTabMinWidth(90); tp.setTabMaxWidth(90); tp.setTabMinHeight(60); tp.setTabMaxHeight(60); */ tps[i] = tp; } // CreateTP public static void main(String[] args) { Application.launch(args); } } // TabPaneTest3