Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2006

Tip: Looking for answers? Try searching our database.

Update GUI while waiting on network result

Thread view: 
carlg@libertybasic.com - 20 Dec 2006 21:47 GMT
How do I force my JLabel to display on the screen when I set it's
contents before some business, like for example some JMS communication
over a slow network?

 myLabel.setText("Now commencing network communication...");
 myJMSTask.go();

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com
Andrew Thompson - 20 Dec 2006 21:57 GMT
> How do I force my JLabel to display on the screen when I set it's
> contents before some business, ..

..ensure 'the business' is not done on the EDT.

Andrew T.
carlg@libertybasic.com - 21 Dec 2006 03:10 GMT
> > How do I force my JLabel to display on the screen when I set it's
> > contents before some business, ..
>
> ..ensure 'the business' is not done on the EDT.

What exactly do you mean by EDT?  Are you saying I should kick off a
thread with 'the business' in it?  Perhaps that'll work.

-Carl
Ian Wilson - 21 Dec 2006 10:30 GMT
>>>How do I force my JLabel to display on the screen when I set it's
>>>contents before some business, ..
>>
>>..ensure 'the business' is not done on the EDT.
>
> What exactly do you mean by EDT?  

Andrew is referring to the Event Dispatching Thread. This is where all
the GUI work goes on, listening for user actions and responding. If you
want a responsive GUI then you must ensure that non-GUI work does not
block the EDT.

> Are you saying I should kick off a
> thread with 'the business' in it?  Perhaps that'll work.

He is, it will. Don't forget to Thread.setPriority(Thread.NORMAL);


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.