I\'m writing a java program and, before I call a method that makes heavy use of the CPU, I display a frame with a JProgressBar on it. Although I display it before the method is
You are blocking the EDT from repainting the GUI.
Read the section from the Swing tutorial on Concurrency in Swing for a full explanation of the problem.
Also, read the section on "How to Use Progress Bars" for a working example.