As stated from Sun that actionPerformed() from ActionListener is executed in EDT automatically so I’ve decided to create new thread inside actionPerformed() method and the problem is this thread is not running inside EDT. Can someone explain this? Thanks
As stated from Sun that actionPerformed() from ActionListener is executed in EDT automatically so
Share
If you create a new thread from EDT that thread is different than the EDT. Isn’t that clear?
You are supposed to update controls via the EDT.
You can create your own background threads for heavy tasks but the update of the controls should be only via the EDT.
There are constructs for you to use to facilitate your code e.g. pass a
Runnableto be called by EDT via SwingUtilities invoke Runnable. You should study about Concurrency in Swing