JOptionPane.showMessageDialog is supposed to be a useful utility for getting user feedback as it blocks your current thread while you wait.
I would expect therefore that it would be thread-safe and that you wouldn’t need to wrap the call in an invokeLater or an invokeAndWait.
Is this the case?
Taken from the javax.swing package description:
JOptionPane does not document that it is thread safe, so you have to use
invokeLater().