How to get width of GridPane in JavaFX

Hello, I'm new to javafx and I would like to know how to get width of GridPane, because I would like to center it in AnchorPane. Or is there any other solution to center it without calculations??
4 Replies
JavaBot
JavaBot3y ago
Hey, @fertiz! Please remember to /close this post once your question has been answered!
LinusHuck
LinusHuck3y ago
i am not sure but maybe gridPane.setAlignment(Pos.CENTER);
fertiz
fertizOP3y ago
tried it, didn't work nvm got it
JavaBot
JavaBot3y ago
Post Closed
This post has been closed by <@723844486974668810>.

Did you find this page helpful?