I\'m making a game and i need to update the JProgressBar every 3 seconds. To do that i use a while loop. The problem is that my program freezes becuse of the while loop (i read
You will need to use threads for that. But be careful, and don't try to update the GUI component (JProgressBar) from a thread that does not own the progress bar.
You should use SwingUtilities.invokeLater to do that.