public class EffectTest extends Application {
 @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);
            tab.setContent(hbox);
            
            tab.setClosable(false);
            
            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();
    }
}
//  

 

相关文章:

  • 2021-08-01
  • 2022-12-23
  • 2022-02-06
  • 2021-12-24
  • 2021-10-09
  • 2021-04-02
  • 2022-12-23
猜你喜欢
  • 2021-09-22
  • 2022-12-23
  • 2021-08-05
  • 2021-08-28
  • 2022-12-23
  • 2021-07-14
  • 2021-12-05
相关资源
相似解决方案