🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17187

Re: Switching between panels in frames

#17187
From: John Sutter
Date: Wed, 09 Dec 1998 00:00
39 lines
1432 bytes
How about adding both, but using the setVisible (...) method
to turn on/off the appropriate panel.  invoke pack () after each
set of changes change.

Works for my app. 

-- John


Jonathan wrote:
> 
> I have a frame which uses to panels, at seperate times.
> 
> The only problem is theat when i switch between the panels the transition is
> not good
> 
> i am using
> 
> SomeMethod() {
> 
> Panel1 Pan1 = new Panel1();
> 
> this.getContentPane().add(Pan1, BorderLayout.CENTER);
> 
> this.getContentPane().remove(Pan1);
> 
> Panel2 Pan2 = new Panel2();
> 
> this.getContentPane().add(Pan2, BorderLayout.CENTER);
> 
> this.getContentPane().remove(Pan2);
> 
> }
> 
> the result of this is pan2 (panel) displayed on top of pan1 (panel), only by
> resizing using the mouse during execution does panel1 (panel)disappear.
> 
> What should i be doing to
Technical Details
Message-ID: <366ED069.C2B07E13@webscope3d.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <74mbds$c9t6@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,3ac95e130a8e99f
X-Google-Attributes: gidf74b3,public
From: John Sutter <jds@webscope3d.com>
Subject: Re: Switching between panels in frames
Date: 1998/12/09
Message-ID: <366ED069.C2B07E13@webscope3d.com>
X-Deja-AN: 420529099
Content-Transfer-Encoding: 7bit
References: <74mbds$c9t6@forums.borland.com>
X-Accept-Language: en,ja
Content-Type: text/plain; charset=us-ascii
Organization: WebScope, Inc.
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language