Professional Documents
Culture Documents
java swing is not threadsafe, you can not update swing components like JButton, JLable, JTable
or JTree from any thread, they all need to be updated from just one thread and we call it Event
Dispatcher thread or EDT in short.
Event Dispatcher thread is used to render graphics for java swing components and also process
all events corresponding to a keypress, mouse click or any action.
So if you want to update a particular swing component suppose label of a JButton from Yes to
No you need to do this in Event Dispatcher thread and for doing this you need InvokeLater.
invokeLater is used to perform any task asynchronously on AWT Event Dispatcher thread.
Read more: https://javarevisited.blogspot.com/2011/09/invokeandwait-invokelater-swing-
example.html#ixzz6Q7c214MY