Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SwingUtilities

 
tom mcmorrow
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I was wondering if anyone used SwingUtilities. invokeLater() to stop the GUIs from freezing when blocked listeners wait for lock\unlock on RemoteData instance. If so maybe you could suggest where I might find an explanation of the process - I have studied the example in the Sun Swing tutorial but I seem to be missing something.
Perhaps if i saw another example it might help.
Thanking you
tom
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a thread somewhere here on that subject. It is important to develop a gui that is thread safe. In otherwords, no code that takes a long time must be executed on the event queue and updates to gui components must always be done on the event queue.
To execute someting on the event queue do,
SwingUtitilies.invokeLater(new Runnable() {
public void run() {
//bhah blah..
}
};
enjoy!
 
.sanjeev.
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in "java thread programming" by paul hyade SwingUtilities.invokeAndWait(), SwingUtilities.invokeLater() is very well explained.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic