Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #708

Re: TotallyGridBag

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Ian Wilson" <ian.wilson@THRWHITE.remove-dii-this>
Subject Re: TotallyGridBag
Message-ID <vbqdnZQwjtwNhzPYnZ2dnUVZ8sSrnZ2d@bt.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <1169035511.688189.5730@m58g2000cwm.googlegroups.com>
References <1169035511.688189.5730@m58g2000cwm.googlegroups.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 49
Date Wed, 27 Apr 2011 15:29:06 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918146 96.60.20.240 (Wed, 27 Apr 2011 10:29:06 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:29:06 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:708

Show key headers only | View raw


  To: comp.lang.java.gui
Andrew Thompson wrote:
> Ian Wilson wrote:
> 
>> I was putting together some comparisons of Layout Managers and am a bit
>> stuck with GridBagLayout.
> 
> 
> (chuckle) When I saw you recommending it
> on another groups, I was almost about to add
> that I preferred nested layouts, for any number
> of reasons.
> 

I usually recommend MigLayout but I recognise that some learners might 
want to stick with Sun's layout managers. :-)

> 
>> ...In the example below, if you resize the frame
>> so it is a bit narrower, the Password JTextField collapses to zero width.
>> Clues?
>>
<snip>
>          JTextField tf = new JTextField(10);
>          tf.setMinimumSize( new java.awt.Dimension(30,20) );
>          add(tf, gc);  // (Does not) Collapses (too far) if frame
> shrunk!
> 
<snip>

Thanks Andrew :-)

> GBL usually behaves until it strikes a component
> with no minimum size set, but cannot give it its
> preferred size.  Then it simply reduces it to '0'.
> 
> That is one of the reasons I avoid it.  I have
> encountered no layout besides GBL that you
> need to worry about setting a minimum size.

I'd be happier if component's constructors set min and max sizes 
different from preferred (e.g. by half/twice unless programmer set) and 
if all Sun's layout managers used them consistently. Doubtless there are 
good reasons for the way things are.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

TotallyGridBag "Ian Wilson" <ian.wilson@THRWHITE.remove-dii-this> - 2011-04-27 15:29 +0000
  Re: TotallyGridBag "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:29 +0000
    Re: TotallyGridBag "Ian Wilson" <ian.wilson@THRWHITE.remove-dii-this> - 2011-04-27 15:29 +0000

csiph-web