Article View: borland.public.jbuilder.java.swing
Article #9687Re: What class to use for a StatusBar?
From: Tor Iver Wilhelmsen
Date: Wed, 16 Feb 2000 00:00
Date: Wed, 16 Feb 2000 00:00
14 lines
1100 bytes
1100 bytes
"Sweder Schellens" <sweder.schellens@qa-systems.com> writes:
> JLabel statusBar = new JLabel();
> statusBar.setText("Scanning " + directory.toString());
>
> The problem is that the status bar doesn't display anything at all.
> It looks like an update problem.
> What am I doing wrong?
You are calling setText() while in the AWT event thread. The actual
update in the GUI won't happen until the thread finishes with your
code and gets to the repaint() event pending.
Solution: Do the actual "work" in a separate thread.
Technical Details
Message-ID:
<uk8k5nyne.fsf@sds.no>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<88b0si$j5j6@bornews.borland.com> <uael2g2p1.fsf@sds.no> <88bfs8$jd01@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,85b51552b2a3f7ef X-Google-Attributes: gid111d45,public From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no> Subject: Re: What class to use for a StatusBar? Date: 2000/02/16 Message-ID: <uk8k5nyne.fsf@sds.no> X-Deja-AN: 586487396 Sender: towi@SDSA1761 References: <88b0si$j5j6@bornews.borland.com> <uael2g2p1.fsf@sds.no> <88bfs8$jd01@bornews.borland.com> Supersedes: <uln4lnyzv.fsf@sds.no> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing