My question is related to SwingUtilities.invokeLater
. When should I use it? Do I have to use each time I need to update the GUI components? What does it exactly
Every Swing application has at least 2 threads:
If you want to update the UI you should execute code within the EDT. Methods like SwingUtilities.invokeLater, SwingUtilities.invokeAndWait, EventQueue.invokeLater, EventQueue.invokeAndWait allow you to execute code by the EDT.