-
Difference between GridBagConstraits.fill adn GridBagConstraints.weightx/y
I am haveing trouble laying out a JFrame using the GridBagLayout manager.
I read the sun sit documentation, however I am still haveing problems.
Could someoneplease tell me the difference between GridBagConstraints.fill
and GridBagConstraints.weight. To me they sound like they do the same thing.
Help Please,
Thanks, Harry
-
Re: Difference between GridBagConstraits.fill adn GridBagConstraints.weightx/y
Harry Tuttle <harrytuttle89@hotmail.com> wrote in message
news:391c76c6$1@news.devx.com...
>
> I am haveing trouble laying out a JFrame using the GridBagLayout manager.
> I read the sun sit documentation, however I am still haveing problems.
> Could someoneplease tell me the difference between GridBagConstraints.fill
> and GridBagConstraints.weight. To me they sound like they do the same
thing.
>
>
> Help Please,
>
> Thanks, Harry
I haven't used a GridBagLayout, but my reading of the documentation is this:
The "weight" fields are arbitrary numbers from 0 to ?, and components with
larger "weight" are more important and will be assigned a larger share of
any extra space that exists.
The "fill" field is a nearly Boolean field that says whether the component
will expand to fill any extra space that has been assigned to it, and if so
whether in the horizontal or vertical direction or both.
So I'd guess that the weights are applied first to divide up empty space
between components, and the fill applies later to see if the components will
expand into the divided-up empty space. But I could be wrong. Best of
luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|