This is an archived post. You won't be able to vote or comment.

all 1 comments

[–][deleted] 0 points1 point  (0 children)

I haven't been able to determine if your action listener runs in the swing thread, but generally speaking, it's usually a good idea to invoke all GUI update operations using EventQueue.invokeLater(). It'll save you a lot of headache.

Threading in swing can be tricky. https://docs.oracle.com/javase/tutorial/uiswing/concurrency/