When I put a datagrid in the center of a borderpan...
# tornadofx
s
When I put a datagrid in the center of a borderpane, then resize the window, the datagrid automatically rearranges the boxes to resize for me. However, when I put the datagrid on the right, this doesn't work anymore. Why is that, and how can I correct it?
r
The issue is how
BorderPane
resizes its sections.Basically, it's designed to give the borders their preferred size, and give the remainder of the space to the center. So if you resize the pane, all the borders stay at their preferred size and the center resizes to account for the change.
s
Interesting! Thanks.
r
Sure thing. You can read more about it in the documentation: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/layout/BorderPane.html The JavaFX documentation is quite approachable.