Sounds like you're running the long running process in the event dispatch thread, and that blocks the GUI from updating. While the event dispatch thread is busy completing the task, no drawing can happen, as swing does all its work in the same thread. Thus updating the GUI can not happen until the task has been completed and swing is given a chance to do its work (which can be never, if the task is an infinite loop).
The solution is running time consuming tasks in the background. SwingWorker is usually the most convenient tool for background tasks.