I want to create a GridPane with 3 columns in JavaFX using FXML. There is a big label in center column. The center column takes the width of the label. The left and right column share each half (50%) of the remaining width of the form. I tried PercentWidth to 50 to left and right columns. However, the widths are set to 50 percent of the whole form but not the remaining width. For instance, the form is 1000px width. The center column may take 400px while the left and right column each takes 300px. This formula should maintain even if the form is resize during run time.
Asked
Active
Viewed 1,473 times
1 Answers
0
Just make the center column use USE_COMPUTED_SIZE
for preferred width, and for the other 2 columns, set HGrow
to ALWAYS
. Also set SOMETIMES
for center column's HGrow
.

Jai
- 8,165
- 2
- 21
- 52