If you're doing all these things with some GUI, then your issue might be because of you invoke your loop in event dispatcher thread. If this is the case, make sure to invoke all the "heavy" stuff...