Article View: borland.public.jbuilder.java.swing
Article #12812Re: Repainting problem on initially invisible panel
From: Matt Krevs
Date: Tue, 03 Nov 1998 00:00
Date: Tue, 03 Nov 1998 00:00
32 lines
1497 bytes
1497 bytes
After you call setVisible() you need to call validate() for the container of
the Panel you just made visible.
if (jPanel2.isVisible ())
{
jPanel2.setVisible (false);
jButton1.setText ("Display second Panel");
}
else
{
jPanel2.setVisible (true);
jButton1.setText ("Hide second Panel");
}
----> this.validate();
Paul Waldo wrote in message <71kh5h$3sb5@forums.borland.com>...
>Hi all,
>
>I'm am having difficulty with a simple app. I wish to initially make a
>panel invisible, and upon a user action, make it visible. When you first
>run the app, and call setVisible (true) on the panel to be displayed,
>nothing happens. A resize or maximize is necessary to have the panel
>displayed. Once the first resize is done, the app works perfectly.
>
>It is easier to see than to describe, so the code is enclosed. Any help
>would be appreciated. TIA.
>
>Paul
>
>
>
Technical Details
Message-ID:
<71lbrv$4m38@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<71kh5h$3sb5@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,cc3216741bcffc34,start X-Google-Attributes: gid111d45,public From: "Matt Krevs" <mattkrevs@flex.com.au> Subject: Re: Repainting problem on initially invisible panel Date: 1998/11/03 Message-ID: <71lbrv$4m38@forums.borland.com> X-Deja-AN: 407712344 References: <71kh5h$3sb5@forums.borland.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing