Java GUI Framework Question:
Download Questions PDF

What is difference between invokeAndWait and invokeLater?

Java GUI Framework Interview Question
Java GUI Framework Interview Question

Answer:

This swing interview question is asked differently at different point. some time interviewer ask how do you update swing component from a thread other than EDT, for such kind of scenario we use SwingUtilities.invokeAndWait(Runnable r) and SwingUtilities.invokeLetter(Runnable r) though there are quite a few differences between these two, major one is invokeAndWait is a blocking call and wait until GUI updates while invokeLater is a non blocking asynchronous call. In my opinion these question has its own value and every swing developer should be familiar with these questions or concept not just for interview point of view but on application perspective. you can read more on my post How InvokeAndWait and InvokeLater works in Swing

Download Java GUI Framework Interview Questions And Answers PDF

Previous QuestionNext Question
Why Swing components are called lightweight component?Write code for JTable with custom cell editor and custom cell renderer?