Your problem is that your Thread.sleep(...)
and while (true)
loop are both tying up the Swing event thread preventing it from doing its two main jobs of drawing the GUI and interacting with the user. This will effectively freeze your GUI.
You could use a Swing Timer to do your loop without tying up the Swing event thread, but this won't fix problems with time needed to get online and download from a server. Thus I recommend that you instead use a background thread for this such as can be found with a SwingWorker, so as not to tie up and freeze the Swing event thread. Please check out Concurrency in Swing for more on this.