Article View: borland.public.jbuilder.java.swing
Article #10434Re: Refreshing Problem and Thread ????
From: Thomas Festring
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
20 lines
1394 bytes
1394 bytes
Michel PοΏ½rez schrieb in Nachricht <7so3i2$d4n9@forums.borland.com>...
>..., however I called my setMessage() method in the
>middle of the method connection(), but doesn't refresh. I think the vm
>doesn't take care of repaint the components because there are things more
>heavier and important than this.
>How could I fixed this ?
Start a worker thread, which is doing all the operations mentioned above
(connection to EJB server and so on). Write a class "StatusbarRefresher"
implementing the "Runnable" interface, which is calling your
"setMessage"-method from within its "run"-method. From the worker thread you
can access the GUI (thread) by calling SwingUtilities.invokeLater(new
StatusbarRefresher("blablabla")).
See also the in-depth-information as part of Javasoft's Java Tutorial at
http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html.
HTH,
Thomas
Technical Details
Message-ID:
<7sppj5$ri73@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7so3i2$d4n9@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,688133ee834ee9f1 X-Google-Attributes: gid111d45,public From: "Thomas Festring" <tfestring@zeb.de> Subject: Re: Refreshing Problem and Thread ???? Date: 1999/09/28 Message-ID: <7sppj5$ri73@forums.borland.com> X-Deja-AN: 530200258 References: <7so3i2$d4n9@forums.borland.com> Organization: Another Netscape Collabra Server User X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: borland.public.jbuilder.java.swing