First of all:
Sorry that I cannot provide a SSCCE. I tried to recreate this problem on a small project, but without success, or should I say with success, because its working th
The fact that the same code causes problems in some circumstances but not others leads me to suspect your code may not be executing on the AWT event dispatch thread.