In many books weightx
and weighty
values are expressed in different ways:
some says 0.0 to 1.0 other says 0 to 100 other say until 1000
I'm a lot confused.
In the API these variables are double types so I think the first is correct but what does it meaning a value of 0.4 or 0.7? are percentage values, point values? relative of what?
I would follow the examples used in the Swing tutorial on How to Use GridBagLayout.
In that context 1.0 means as the frame grows the components gets all the extra space. 0.0 means it gets no space.
Actually, these are weights. So what counts is that they are all on the same "scale".
It doesn't really matter then if percentage or not, in the end, they are evaluated regarding their total on a dimension. So just use what seems to be the most clear for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With