🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3225

Re: changing the contents of a Panel at runtime

#3225
From: Michael Hall
Date: Mon, 16 Mar 1998 00:00
24 lines
1366 bytes
Try using the following method on the frame:
frameThePanelIsOn.pack(); Or use the pack on the parent any parent
container.

Also if you add buttons that are not showing up the following methods also
help.
panelData.validate();
panelData.repaint();

>I would like to change the contents of a Panel at runtime, so that a
>different form displays depending on which menu item the user picks:  if
>they pick "Xyz", the corresponding panel appears.  If they then pick "Abc",
>Xyz disappears and Abc replaces it.
>
>I tried the following code:
>
>       void menuEntryRetax_actionPerformed(ActionEvent e) {
>         this.setTitle("Real Estate Taxes - " + PLAN_YEAR);
>         EntryRetax theWin = new EntryRetax();
>         panelData.add(theWin, BorderLayout.NORTH);
>       }
>
>but the new panel didn't show up.  What am I doing wrong?
Technical Details
Message-ID: <6eim8q$mt22@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6cg7i6$2936@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,daaffe7081602d1d
X-Google-Attributes: gid1089d0,public
From: "Michael Hall" <mhall01@ibm.net>
Subject: Re: changing the contents of a Panel at runtime
Date: 1998/03/16
Message-ID: <6eim8q$mt22@forums.borland.com>
X-Deja-AN: 334474969
References: <6cg7i6$2936@forums.borland.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.api