zoukankan      html  css  js  c++  java
  • javafx tabPane

    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();
        }
    }
    //  
  • 相关阅读:
    PAT乙级1038
    PAT乙级1033
    PAT乙级1032
    memset初始化数组的坑
    C/C++小课之数组名是什么
    PAT乙级1031
    Alpha阶段 第一次Scrum Meeting
    技术规格说明书
    功能规格说明书
    团队项目选择
  • 原文地址:https://www.cnblogs.com/rojas/p/4724568.html
Copyright © 2011-2022 走看看