I've been having similar problems with Java under Compiz. I noticed that on my Mepis computer and Kubuntu notebook that only the Dialogs fail, not the Frames. I was also able to make the glitch happen with less frequency by calling the garbage collector. I basically set it so the garbage collector ran at the beginning of each actionPerformed(), and this made the Dialogs much more reliable.
I've been having similar problems with Java under Compiz. I noticed that on my Mepis computer and Kubuntu notebook that only the Dialogs fail, not the Frames. I was also able to make the glitch happen with less frequency by calling the garbage collector. I basically set it so the garbage collector ran at the beginning of each actionPerformed(), and this made the Dialogs much more reliable.