Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX evenly split children

How can I acheive an evenly split UI, as the Player boxes demonstrate in the following example:

Desired UI

I would model it as an HBox with 2 evenly sized VBoxes, but I can't get them to stretch to the same size in the HBox.

like image 292
NightRa Avatar asked May 19 '26 18:05

NightRa


1 Answers

Stretching VBoxes as two halves of single HBox works for me with HBox.hgrow="ALWAYS" property set for both VBoxes:

<HBox>
  <VBox HBox.hgrow="ALWAYS">
    ...
  </VBox>
  <VBox HBox.hgrow="ALWAYS">
    ...
  </VBox>
</HBox>
like image 193
vdshb Avatar answered May 22 '26 22:05

vdshb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!