Let's say, hypothetically, that I have a very simple GUI. Suppose I
have a JPanel taking up most of a JFrame, and that based on some
unrelated factors(some numerical instance), I want this JPanel to go
away, and have a different(already instantiated) JPanel take its place.
This seems like it should be really easy, can anyone explain how to
accomplish this?
thank you.
TS
Roedy Green - 14 Jan 2006 05:59 GMT
>I want this JPanel to go
>away, and have a different(already instantiated) JPanel take its place.
You can have both added, and alternately setVisible either one, the
revalidate.
You can add/remove them.
You can use a CardLayout
See http://mindprod.com/jgloss/layout.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Chris Smith - 14 Jan 2006 06:06 GMT
> Let's say, hypothetically, that I have a very simple GUI. Suppose I
> have a JPanel taking up most of a JFrame, and that based on some
> unrelated factors(some numerical instance), I want this JPanel to go
> away, and have a different(already instantiated) JPanel take its place.
> This seems like it should be really easy, can anyone explain how to
> accomplish this?
See java.awt.CardLayout

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
technoscience@gmail.com - 14 Jan 2006 07:21 GMT
Thank you Mr.Green and Mr.Smith, I really appreciate your help.