JavaFX网格变形



在Scene Builder中添加gridpane到AnchorPane有问题!当我把GridPane放入窗口时,它就完全变形了。实际的窗口在它应该在的位置,但网格的行和列被移位。截图显示了我的意思:

Gridpane

尝试将场景生成器更新到2.0或更高版本,并重新添加GridPane或尝试将布局设置从USE_COMPUTED_SIZE更改为常量。如果需要的话,可以在java中添加GridPane:

    @FXML
    AnchorPane root;//This will be at the top of the page bellow where you define your class
    GridPane gridPane = new GridPane();
    root.getChildren().add(GridPane);//switch root out for the name of you anchor pane

最新更新