You should always update the GUI in the event dispatch stream (EDT). However, as Jeffrey notes in the comments, the ActionListener.actionPerformed
method of the ActionListener.actionPerformed
object is already called from the EDT.
If you just want JButton
look at / unenabled enabled or add / remove elements from the JList
and you make these changes through the ActionListener
in the Swing component, then you do not need to invoke SwingUtilities.invokeLater
explicitly.
source share