Your problem in next: you block EDT
in your ActionListener
, because of your frame freezes until actionPerformed()
method will be exited. When you use Thread.sleep(...)
it doesn't help Swing
to repaint your frame.
Seems you need to use Swing Timer for updating. Also you can use SwingWorker for long time background processes.
Read about Concurency in Swing.