invokeLater() and invokeAndWait()
843804Feb 17 2005 — edited Feb 17 2005I'm somewhat confused about when to use these.
from http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html - it says "you must take extreme care that Swing components and models are created, modified, and queried only from the event-dispatching thread"
I also understand that these two methods are basically the same though invokeAndWait only returns once the run() has completed while invokeLater will return immediately.
So, when should I use these? and which one should I use?
If I'm creating the GUI initially, use the invokeAndWait()
If I'm updating/quering the GUI components, use invokeLater()
is this the correct way of thinking?