Example usage for javafx.scene.control TabPane setSide

List of usage examples for javafx.scene.control TabPane setSide

Introduction

In this page you can find the example usage for javafx.scene.control TabPane setSide.

Prototype

public final void setSide(Side value) 

Source Link

Document

The position to place the tabs in this TabPane.

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Tabs");
    Group root = new Group();
    Scene scene = new Scene(root, 400, 250, Color.WHITE);

    TabPane tabPane = new TabPane();

    BorderPane borderPane = new BorderPane();
    for (int i = 0; i < 5; i++) {
        Tab tab = new Tab();
        tab.setText("Tab" + i);
        HBox hbox = new HBox();
        hbox.getChildren().add(new Label("Tab" + i));
        hbox.setAlignment(Pos.CENTER);//from  w w w. j a va  2s .  c  o  m
        tab.setContent(hbox);
        tabPane.getTabs().add(tab);
    }
    tabPane.setSide(Side.LEFT);
    //tabPane.setSide(Side.TOP);
    //tabPane.setSide(Side.RIGHT);
    //tabPane.setSide(Side.BOTTOM);

    // bind to take available space
    borderPane.prefHeightProperty().bind(scene.heightProperty());
    borderPane.prefWidthProperty().bind(scene.widthProperty());

    borderPane.setCenter(tabPane);
    root.getChildren().add(borderPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:org.jamocha.gui.JamochaGui.java

private Scene generateScene() {
    final TabPane tabPane = new TabPane();
    tabPane.setSide(Side.LEFT);

    this.log = new TextArea();
    final Tab logTab = new Tab("Log");
    logTab.setContent(this.log);
    logTab.setClosable(false);//  w  w  w  .  j  a  va  2 s.  c  o m

    final Tab networkTab = new Tab("Network");
    networkTab.setClosable(false);
    final ScrollPane scrollPane = new ScrollPane();
    networkTab.setContent(scrollPane);

    this.networkVisualisation = new NetworkVisualisation(this.jamocha.getNetwork());
    this.networkVisualisation.setTranslateX(10);
    this.networkVisualisation.setTranslateY(10);
    this.networkVisualisation.update();
    scrollPane.setContent(this.networkVisualisation);

    tabPane.getTabs().addAll(logTab, networkTab);

    final Scene scene = new Scene(tabPane);
    tabPane.prefHeightProperty().bind(scene.heightProperty());
    tabPane.prefWidthProperty().bind(scene.widthProperty());
    return scene;
}