🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #13070

Panel refresh problem

#13070
From: Frode Oldervoll
Date: Fri, 02 Oct 1998 00:00
24 lines
1302 bytes
I have a JPanel (a)  that contains different other JPanels (b), one at a
time, and I change the conent of panel a dynamically according to menu
selections. My problem is that when I change the panels b the panel a won't
redraw itself. I have tried various combinations of invalidate, validate,
revalidate, etc., as in the code included below:

    a.removeAll();
    b.setVisible(true);
    a.add(b, "Center");
    b.validate();
    a.invalidate();
    a.validate();
    a.revalidate();

With all these validate-methods, the panel a still don't redraw itself with
the correct content b. It works the first time I select a panel, but later I
don't work.

What is the correct way to solve such a problem?

By the way, I use JDK 1.1.7 and Swing 1.0.3, but the problem is the same
with JDK 1.1.6_Borland and Swing 1.0.1.

-Frode
Technical Details
Message-ID: <6v24o7$3kh7@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,d70978371e769ca6,start
X-Google-Attributes: gid111d45,public
From: "Frode Oldervoll" <Frode.Oldervoll@cmr.no>
Subject: Panel refresh problem
Date: 1998/10/02
Message-ID: <6v24o7$3kh7@forums.borland.com>
X-Deja-AN: 396984569
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Newsgroups: borland.public.jbuilder.java.swing