Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set tabs position in JavaFX
    primarykey
    data
    text
    <p>I have this JavaFX code with tabs. Can you tell me how I can set the position of the tabs panel to be always on the left side of the main stage:</p> <pre><code>VBox stackedTitledPanes = createStackedTitledPanes(); ScrollPane scroll = makeScrollable(stackedTitledPanes); TabPane tabPane = new TabPane(); BorderPane mainPane = new BorderPane(); tabPane.setStyle("-fx-font-size: 12pt;"); // Set global size for the font // Create Tabs Tab tabA = new Tab(); tabA.setText("Main Component"); tabA.setStyle("-fx-font-size: 12pt;"); // Set size of the tab name // Add something in Tab StackPane tabA_stack = new StackPane(); tabA_stack.setAlignment(Pos.CENTER); tabA_stack.getChildren().add(scroll); tabA.setContent(tabA_stack); tabPane.getTabs().add(tabA); Tab tabB = new Tab(); tabB.setText("Second Component"); tabB.setStyle("-fx-font-size: 12pt;"); // Set size of the tab name // Add something in Tab StackPane tabB_stack = new StackPane(); tabB_stack.setAlignment(Pos.CENTER); tabB_stack.getChildren().add(new Label("Label@Tab B")); tabB.setContent(tabB_stack); tabPane.getTabs().add(tabB); Tab tabC = new Tab(); tabC.setText("Last Component"); tabC.setStyle("-fx-font-size: 12pt;"); // Set size of the tab name // Add something in Tab StackPane tabC_vBox = new StackPane(); tabC_vBox.setAlignment(Pos.CENTER); tabC_vBox.getChildren().add(new Label("Label@Tab C")); tabC.setContent(tabC_vBox); tabPane.getTabs().add(tabC); mainPane.setCenter(tabPane); mainPane.setPrefSize(395, 580); mainPane.setLayoutX(850); mainPane.setLayoutY(32); scroll.setPrefSize(395, 580); scroll.setLayoutX(850); scroll.setLayoutY(32); root.getChildren().add(mainPane); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload