Actions triggered by the Swing Timer, as well as runnables submitted to invokeLater
, are all executed sequentially on the Event Dispatch Thread, and as long as you don't involve invokeAndWait
, no other thread is waiting for an action to complete. Therefore no deadlock can arise from this usage pattern alone. If you do encounter a deadlock, the cause will not be related to the EDT and its event processing.
You do not need invokeLater
from within any event callback, which includes the one submitted to the Swing Timer, because they are already guaranteed to be called on the Event Dispatch Thread.