JDialog boxes black

I have an application based on a JFrame that contains many sub JPanels that are often resized. I also will let the user create popup JDialogs that will contain a JPanel that exposes some functionallity. While these JDialogs will initially render property as Swing components should, when I start to move a scroll bar or enter text into a jlabel, the entire JDialog’s area will clear to black. The only way to get it to redisplay is to either explicity repaint a component (mouseover a JBunnon, for instance) or destroy and recreate the JDialog.

Is there some way around this? I thought JDialogs were supposed to be heavyweight?

Where is JOGL involved?

What platform are you on? It sounds like you are on Windows and forgot to specify -Dsun.java2d.noddraw=true.

Sorry. Forgot to mention that I’m using a JCanvas inside my JFrame.

I’m making the following calls at the first instructions in my main() program. I’ve now added the sun.java2d.noddraw, but it has not helped.

    System.setProperty("sun.awt.noerasebackground", "true");
    System.setProperty("sun.java2d.opengl", "true");
    System.setProperty("sun.java2d.noddraw", "true");

Do you mean a GLJPanel or a GLCanvas?

Are you launching your program via Java Web Start or via the command line? If by Web Start, your System.setProperty() calls are being made too late. They may also be occurring too late if you instantiate components in the static initializer of your main class. You should test with specifying them on the command line and see whether that makes a difference.

Also I wouldn’t recommend using -Dsun.java2d.opengl=true if you’re using a GLCanvas (there’s no need for it and the Java2D/OpenGL pipeline can interfere with JOGL’s operation), only if you’re using a GLJPanel.

I mean a GLCanvas. I’m launching both from inside the NetBeans IDE and by the command line via ant.

After removing -Dsun.java2d.opengl=true, the problem went away.

Where can I find a description of the set of switches relevant to JOGL I can set at the command line?

Thanks.

The JOGL User’s Guide is a good start and also links to the forum discussion covering the Java2D/JOGL bridge.