🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Changing panels within a frame

#12680
From: John P. McGrath
Date: Mon, 23 Nov 1998 00:00
26 lines
1446 bytes
Matt Stauffer <matts@jmaca.com> wrote:

> Once the user clicks the "Next >>" button I want to remove
> the first panel and then put the second panel in its place
> on the frame and trash the first panel (I figured this would
> be better then trashing the whole frame and creating a whole
> new frame).

> What is currently happening is it displays the first panel
> properly, when I click the "Next >>" button it prints out
> the debugging message in my event handler and it appears to
> remove the first panel, but it doesn't display the second
> panel. It just shows an empty frame.

When you add a Component to a Container (in this case the frame), you 
must validate() the Container.  This causes the layout manager to be 
called, which is what sets the size of the Component.  If this is not 
done, the Component will more than likely have a size of [0,0], so 
painting it does not show anything.

-- 
Regards,

John P. McGrath
<mcgrath@enter.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID: <MPG.10c2eaf3b6e5bdf1989730@forums.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3658C12C.DA95AA40@jmaca.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,facde98a621e3092
X-Google-Attributes: gid111d45,public
From: mcgrath@enter.net (John P. McGrath)
Subject: Re: Changing panels within a frame
Date: 1998/11/23
Message-ID: <MPG.10c2eaf3b6e5bdf1989730@forums.inprise.com>
X-Deja-AN: 414730186
References: <3658C12C.DA95AA40@jmaca.com>
Organization: Software Consulting Services
Newsgroups: borland.public.jbuilder.java.swing