🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Switching between panels in frames

#17188
From: Matt Welsh
Date: Wed, 09 Dec 1998 00:00
47 lines
1679 bytes
I may be missing something obvious here but what about
just using a java.awt.CardLayout?

John Sutter wrote:
> 
> 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

-- 
Matt Welsh
Inprise Corporation
R&D Engineer, JBuilder
Technical Details
Message-ID: <366EE90D.C082F7BC@inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <74mbds$c9t6@forums.borland.com> <366ED069.C2B07E13@webscope3d.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: Matt Welsh <mwelsh@inprise.com>
Subject: Re: Switching between panels in frames
Date: 1998/12/09
Message-ID: <366EE90D.C082F7BC@inprise.com>
X-Deja-AN: 420565703
Content-Transfer-Encoding: 7bit
References: <74mbds$c9t6@forums.borland.com> <366ED069.C2B07E13@webscope3d.com>
Content-Type: text/plain; charset=us-ascii
Organization: Inprise Corporation
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language