That UI freezing indicates that you are blocking Swing's Event Dispatch Thread. You want to perform all time-consuming tasks explicitly in other threads instead. One simpler way is to use SwingWorker.
http://docs.oracle.com/javase/tutorial/uiswing/concurrency/worker.html