• Post Reply Bookmark Topic Watch Topic
  • New Topic

Event Dispatching thread

 
sun par
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am just now learning Swing from Manning book.Am not able to understand this

Can someone help please
Thanks.
[ April 01, 2003: Message edited by: sun par ]
 
Greg Charles
Sheriff
Posts: 3010
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a tough concept. Basically, most of what you do to change a GUI is based on a user poking at it, e.g., the user pokes a button, and you turn all the cells in a table rainbow colors. That kind of thing you don't have to worry about because all the calls you make come from event handlers, which are running in Swings Event Dispatching Thread already.
However, let's say you have to update a GUI based on other kinds of input. For example, you display a stock ticker that updates every time a new quote is received. Instead of making the update calls directly, you have to create a Runnable object and pass it to SwingUtilities.invokeLater() or SwingUtilities.invokeAndWait().
I hope that makes sense. If not, I'm sure someone will come around and explain it better!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!