Java Swing Programming Question:
What is the What is the difference between invokeAndWait() and invokeLater()? ?
Answers:
Answer #1invokeAndWait() method in swing is synchronous. It blocks until Runnable task is complete. InvokeLater() method in swing is asynchronous. It posts an action event to the event queue and returns immediately. It will not wait for the task to complete
Answer #2difference between invokeAndWait() and invokeLater() is invokeAndWait() keeps the code on to event thread and waits till the execution of run method is completed whereas invokeLater() keeps the code on event thread and runs the rest of code in the thread.
Previous Question | Next Question |
Which method of the Component class is used to set the position and size of a component? | Why should any swing call back implementation execute quickly? |