🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9849

Re: Help with GridBagLayout manager

#9849
From: Paul Furbacher [TeamB]
Date: Mon, 10 Jan 2000 00:00
27 lines
1878 bytes
Jeff Marendo wrote:

> As it is, I'm using one JPanel that has GridLayout(2, 0).  Then I have two
> JPanels for each row, and each one of those panels uses the GBL with all of
> the components I need.  That looks like it will give me better control and
> make it easier to maintain.  The main two problems that I'm still having,
> though, are 1) some of the cells are bigger than the size of the components
> within, and I want to shrink those cells to fit the size of the contained
> component.  The other problem I'm having is minor, but I can't get the first
> component in the top JPanel to align correctly with the first component in
> the bottom JPanel.

The latter problem is sometimes very difficult to overcome.  One
thing you can do is set the "preferredSize" and "minimumSize"
of both components to the the same values.  Also, you probably
do not want to allow them to stretch horizontally, so set the X weight
to 0.0.

> I'll submit some of my code later and maybe someone can see something that I
> don't.  Thanks for the reply.

Post it, and I'll play with it in the Designer.  Actually, I find
that playing with the GridBagLayout constraints editor is
fun.  


Paul Furbacher  (TeamB)
Technical Details
Message-ID: <387A698D.DA042C1F@bilbo.bio.purdue.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <85507g$rmg5@bornews.borland.com> <38761BBD.73B606DD@inprise.com> <855ku4$s2s10@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,ecbc9a69fd2dad64
X-Google-Attributes: gid111d45,public
From: "Paul Furbacher [TeamB]" <pf@bilbo.bio.purdue.edu>
Subject: Re: Help with GridBagLayout manager
Date: 2000/01/10
Message-ID: <387A698D.DA042C1F@bilbo.bio.purdue.edu>
X-Deja-AN: 570920136
Content-Transfer-Encoding: 7bit
References: <85507g$rmg5@bornews.borland.com> <38761BBD.73B606DD@inprise.com> <855ku4$s2s10@bornews.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: Reverse Alchemy, Inc.
Mime-Version: 1.0
Reply-To: pf@bilbo.bio.purdue.edu
Newsgroups: borland.public.jbuilder.java.swing