answersLogoWhite

0

When should the method invokeLater be used?

Updated: 12/10/2022
User Avatar

Pravpriya

Lvl 1
11y ago

Best Answer

invokeLater should be used when your code is performing a GUI change in the Swing UI library, and you cannot guarantee that the change is being made in the Event Dispatching Thread (which can cause data problems, as Swing is not "thread-safe"). So, invokeLater should be used if (1) you are using Swing, and (2) you are using Thread, and (3) the thread from 2 needs to update a GUI element that is part of Swing.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: When should the method invokeLater be used?
Write your answer...
Submit
Still have questions?
magnify glass
imp