I tried two workarounds:
- Setting the environment variable AWT_TOOLKIT=MToolkit. This solved the problem with empty Swing dialog windows but introduced a new problem with windows losing keyboard focus.
- I also installed Sun's JDK6.0 update 10 beta (build24) and used this to run IntelliJ IDEA. Compiz now works correctly with IntelliJ IDEA.