🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Frame Size Expansion ?

#11439
From: Paul Furbacher
Date: Mon, 31 May 1999 00:00
37 lines
2061 bytes
Sohan Mendis wrote:
> 
> I have design a frame with set of controls on it. When I run the Frame ,
> height  of it gets incremented. ie I have set a my cancel and ok buttons at
> the bottom , but space between buttons and the frame edge gets widen. The
> layout I am using is XYLayout. I have specifically set the height and width.
> 
> Why ?

Are you calling "pack()" somewhere in your code just after
setting the frame to be visible?  If you don't like that behavior,
call "validate()" instead.

However, as soon as you learn more about layouts (and
you should force yourself to do so immediately) you should
abandon the use of the XYLayout.  Borland specifically 
says that XYLayout exists to aid you in designing the 
user interface of frames and panels.  Once you have laid
out all controls, you are highly encouraged to set the 
frame or panel's layout to "GridBagLayout".

I've said this many times in these newsgroups:  no matter
how imposing the GridBagLayout appears, no matter how
intimidating it initially is, force yourself to learn it as well
as you know how to write your own name.   If you want
to make pleasing and aesthetic run-anywhere user 
interfaces, you must use the GridBagLayout.

It threw me for a loop the first time I worked with it, but
the struggle (several years ago, now) was worth it. 

In addition, JBuilder 2.0 and 2.01's GridBagLayout property
editor make tweaking of all components in a frame/panel
a snap.


Paul Furbacher
Technical Details
Message-ID: <37534E0F.B3C1E475@bilbo.bio.purdue.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7it8l7$d5d3@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,8e8af09616cacfb0
X-Google-Attributes: gid111d45,public
From: Paul Furbacher <pf@bilbo.bio.purdue.edu>
Subject: Re: Frame Size Expansion ?
Date: 1999/05/31
Message-ID: <37534E0F.B3C1E475@bilbo.bio.purdue.edu>
X-Deja-AN: 484306870
Content-Transfer-Encoding: 7bit
References: <7it8l7$d5d3@forums.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