I was wondering when does the event dispatch thread start in Java.
Is it the main thread, or is it started in Window/Frame
constructor?
Is it started by JVM
if it detects usage of AWT/Swing
?
Main thread is not the EDT thread. EDT thread (and some another related threads) is started automatically when the first GUI event is posted (for example: you show first window or you use the method SwingUtilities.invokeLater
). For more info see the class EventQueue
.