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


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

Re: problem with setting

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.alt.net!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this>
Subject Re: problem with setting
Message-ID <1164744474.985274.82960@14g2000cws.googlegroups.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <456c8f93$1@dnews.tpgi.com.au>
References <456c8f93$1@dnews.tpgi.com.au>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 46
Date Wed, 27 Apr 2011 15:26:21 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303917981 96.60.20.240 (Wed, 27 Apr 2011 10:26:21 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:26:21 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:234

Show key headers only | View raw


  To: comp.lang.java.gui

Michael Dunn wrote:
> "Adam Sandler" <corn29@excite.com> wrote in message
> news:1164735690.470933.19080@80g2000cwy.googlegroups.com...
> >
> > Michael Dunn wrote:
> >> try this
> >
> > Thanks for the reply.
> >
> > A couple of things... I thought GridBag was going in away in favor
> > FormLayout.  Also, with regard to using setPreferredSize, see
> > http://groups.google.com/group/comp.lang.java.gui/browse_thread/thread/199fe80825ff337/0e96c1a7ea07b03b
> >
> > So while your code works (thanks again!), I'm wondering what is the
> > root cause behind why the original code doesn't.  If there's some
> > serious issues regarding the use of GridBag and setPreferredSize, then
> > perhaps another solution needs to be sought.
>
>
>
> default layout for contentPane is borderLayout, default placement is CENTER,
> and default behavior for CENTER is to occupy all remaining space after
> NORTH,SOUTH,WEST,EAST are set, so
> getContentPane().add(centerPanel);
> means centerPanel will occupy all of the size, regardless of its preferredSize
>
> I could have added a panel (holdingPanel) and added centerPanel to that, then
> added holdingPanel to the contentPane - the effect of this would be that
> holdingpanel would take up the additional space in CENTER, and
> centerPanel would get its preferredSize, but centerPanel would appear at
> the top center - not what you want.
>
> GridBagLayout was used so centerPanel would be 'centered', left/right and
> top/bottom. The effect would have been the same if holdingPanel was set as
> a GridBagLayout, and contentPane remained as BorderLayout.
>
> experiment, changing as described above, to see the differences (or no differences)

Thanks!

---
 * 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 | Next in thread | Find similar


Thread

problem with setting a pa "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: problem with setting "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: problem with setting "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
      Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: problem with setting "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: problem with setting "Fred Kleinschmidt" <fred.kleinschmidt@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: problem with setting "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: problem with setting "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: problem with setting "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: problem with setting "Adam Sandler" <adam.sandler@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000

csiph-web