Reputation: 2731
I have a GridPane displaying descriptive Labels on the left side and content Labels on the right side. I set everything to USE_COMPUTED_SIZE
in SceneBuilder and added padding to my elements so they don't stick together too closely. This works well if it wasn't for the fact, that the left-side Labels are cut off, if the content is big enough to take up the whole width of the scene:
Is there a way of making sure that my left-side labels are displayed in full, before the right side labels get their share of available width? Setting the minimum width of the first column to a concrete value works, but i would like JavaFX to determine the needed size for the first column.
Upvotes: 2
Views: 1891
Reputation: 82531
Use Text
s (can be found in Shapes) instead of Label
s in the first column. In contrast to Label
s Text
s are not resizeable and GridPane
cannot resize the first column to become smaller than the largest of the Text
nodes in this column.
Upvotes: 5