0
votes

I have a problem adding a gridpane to an AnchorPane in Scene Builder! The GridPane is completely out of shape as soon as I put it into the window. The actual window is at the position where it is supposed to be but the grid with the rows and columns is displaced. A screenshot shows what I mean:

Gridpane

1
I've been experiencing this issue as well. For me it was solved when restarting Scenebuilder thou. If you check the preview window, is it in place then? (you can test this with showing gridlines of the gridpane for example)Perneel
In the preview it is in shape but restarting SB did not solve the prob for me and it is kinda annoying, cos it makes it hard to work with the cells and stuff like that!Alex

1 Answers

0
votes

Try updating scene builder to 2.0 or higher and re-add the GridPane or try changeing the layout settings from USE_COMPUTED_SIZE to constants. Or if it comes to it add the GridPane in java by doing:

    @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

I hope this helps.