Why would you use swingutilities.invokeandwait or swingutilities.invokelater?



Why would you use swingutilities.invokeandwait or swingutilities.invokelater?..

Answer / Nishant Pal

"SwingUtilities.invokeAndWait() and SwingUtilities.invokeLater() are used to ensure that operations are performed on the Event Dispatch Thread (EDT). These methods allow you to schedule tasks to be executed on the EDT from any thread, which is important for updating the UI and maintaining responsiveness in a Swing application. invokeAndWait() waits for the task to complete before returning, while invokeLater() schedules the task for execution at some point in the future without waiting for its completion."n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Swing Interview Questions

what are the root classes of all classes?

4 Answers  


What is difference between swing and awt?

1 Answers  


What is content pane in swing?

1 Answers  


Which method is used by the applet to recognize the height and width?

1 Answers  


How does accessibility works in swings?

1 Answers  


Is javafx better than swing?

1 Answers  


What are the swing components?

1 Answers  


How to add calendar in java swing using eclipse?

1 Answers  


Why should any swing call back implementation execute quickly?

1 Answers  


What is the role of java swing?

1 Answers  


What is swing package in java?

1 Answers  


What is the base class for all of swing components?

11 Answers   Infosys,


Categories