JavaFX - How to make VBox children grow with VBox parent

后端 未结 1 1824
孤城傲影
孤城傲影 2021-01-20 13:18
VBox classBox = new VBox();
className = new Text(\"defaultClass\");
classBox.setAlignment(Pos.CENTER);
classBox.getChildren().add(className);
classBox.getStyleClass(         


        
1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-20 13:23

    You have to set the vertical grow constraints for the VBoxes:

    VBox.setVgrow(box1, Priority.ALWAYS);
    

    0 讨论(0)
提交回复
热议问题