• Post Reply Bookmark Topic Watch Topic
  • New Topic

Purpose of InvokeLater  RSS feed

 
Billy Sang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am having trouble understanding what the purpose is for the invokelater method I see use so often when using swing? Can anybody please elucidate this for me? Thanks for the help
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Billy Sang wrote:Hi, I am having trouble understanding what the purpose is for the invokelater method I see use so often when using swing? Can anybody please elucidate this for me? Thanks for the help


For the JavaDoc...

invokeLater(Runnable doRun)

Causes doRun.run() to be executed asynchronously on the AWT event dispatching thread.


Looks pretty clear to me. Can you elaborate what you are having trouble understanding? One way is to explain why you think that this method serves no purpose?

Henry
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following appears in the API documentation for just about every Swing class:-
Warning: Swing is not thread safe. For more information see Swing's Threading Policy.
Have you read that?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!