What happens to the main application thread?

Viewed 366

As far as I know, there are 3 threads in a Swing GUI application:

  • the main application thread, which executes the main() method
  • the toolkit thread, which receives the system events
  • the event dispatching thread, dedicated to the painting and event handling of the GUI stuff

Generally, the main method just makes a call to SwingUtilities#invokeLater(Runnable) in order to initialize a window and so on, thus the GUI initialization is made on the EDT... BTW, as far as I know (again), everything that touches the GUI must be executed on the EDT...

Questions: What is the main thread used / usable for? Does it just die after the call to invokeLater()? Does it consume resources? Can I (and is it a good practice to) use it to perform... I don't know... Network stuff?

2 Answers
Related