Article View: borland.public.jbuilder.java.language
Article #17143Re: Switching between panels in frames
From: Steve Waters
Date: Sun, 13 Dec 1998 00:00
Date: Sun, 13 Dec 1998 00:00
55 lines
1930 bytes
1930 bytes
that would seem the obvious thing to do
Regards
Steve
Matt Welsh wrote:
> 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:
<36734FFB.D90E6D57@bellsouth.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<74mbds$c9t6@forums.borland.com> <366ED069.C2B07E13@webscope3d.com> <366EE90D.C082F7BC@inprise.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: Steve Waters <steve_w@bellsouth.net> Subject: Re: Switching between panels in frames Date: 1998/12/13 Message-ID: <36734FFB.D90E6D57@bellsouth.net> X-Deja-AN: 421713765 Content-Transfer-Encoding: 7bit References: <74mbds$c9t6@forums.borland.com> <366ED069.C2B07E13@webscope3d.com> <366EE90D.C082F7BC@inprise.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language