Hi guys, how can I fit component to the parent siz...
# tornadofx
s
Hi guys, how can I fit component to the parent size when I have this hierarchy?
I've tried with fitToParentSize, fitToParentWidth...
r
That picture doesn't actually tell us what the hierarchy is, and I'm not sure what you are trying to fit to what. Could you clarify what it is you're trying to do, and maybe add a mockup of your intended result?
s
Yep sure
I have vbox with 3 hbox childs:
With this code I get:
As you see, there is no scrollbar here, and that's because the listview height is "fillToParent"
If I disable the "fillToParent" I get this:
So... what I want? I want to fill the hbox height to the remaining height
r
Ah, inside the
hbox
, do
vGrow = Priority.ALWAYS
. That will make it stretch to fill the available vertical space.
Copy code
vbox {
    ...
    hbox {
        vGrow = Priority.ALWAYS
        listView(...)
        tableView(...)
    }
}
s
ohhhhh thanks!! It works!! 🙂
r
Good to hear
s
And last question
hgrow works more or less the same?
r
I hope it's not your last question. As soon as we stop asking questions, we stop making any progress 🙂
Yes it does
s
Thanks you! 🙂
r
Many of the JavaFX layouts define such properties. You may want to read into them.
s
Nope, be sure that no, I'm really really noob with tornado haha, working for Android for 6 years
👍 1
Yes, will do, thanks 🙂