JavaFX - How to make VBox children grow with VBox parent

后端 未结 1 1823
孤城傲影
孤城傲影 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)
提交回复
热议问题