I'm working on a sudoku application but I'm having an issue which hinders my advancement. What I'm trying to do is to make this sudoku-board that I have created with loops, which adds a Label into a StackPane and that StackPane goes into it's designated spot into the GridPane. So I'm trying to force this board have a set size and not grow beyond that point.
I've spent the whole evening researching and trying different things, for example putting the GridPane into an AnchorPane and trying to fit the AnchorPane in the center of BorderPane, but it always seems to exceed outside of the window, when you use too many rows and columns for the sudoku board.
What I'm trying to do is to get a set size for all the boards, so if needed it gets stretched to that point, or if needed it gets shrinked. The picture attached is using a BorderPane with a GridPane put in the middle. You can see that the 16x16 fits perfectly while the 25x25 just goes outside the window.
Help would be highly appreciated.
Picture of how the window looks like when trying to create a 25x25.
http://i.imgur.com/BrJrpiY.png
Picture of how the window looks like when trying to create a 16x16. This is also using insets to push it more towards the top so it doesn't look so much out of place.