Problems with AWTGLCanvas and JTabbedPane on Windows

Started by clemensm, February 06, 2012, 15:38:31

Previous topic - Next topic

clemensm

Hello everyone,

I am currently developing an interactive 3D Viewer for Image Analysis using VTK as the background. Because of some problems with Linux and the Java Wrappers of VTK, I had to switch to using LWJGL for displaying the rendered images from VTK (which is written in C++).

The problem is now as follows: The Viewer class is put into a JTabbedPane. If the user switches to the tab or changes the image to be displayed, the image is first rendered (I can confirm this by setting breakpoints at the rendering method), but later drawn over in background gray by some SWING class. See error.png for an example.

When the user then changes anything that forces a redraw, i.e. changing the color map, or rotating one of the images, they are rendered again and then displayed correctly, see correct.png for an example.

Moreover, this only happens on Windows, not on Linux or OSX. So the question is: Is there anything I can do about this, or do I just have to live with it?

Thanks for any help in advance

kappa

You could try set the background of the container on the JTabbedpane not to redraw the background Container.setIgnoreRepaint(true);

clemensm

Quote from: kappa on February 06, 2012, 15:49:02
You could try set the background of the container on the JTabbedpane not to redraw the background Container.setIgnoreRepaint(true);

Thanks for the quick help, setting it on the AWTGLCanvas did the trick (almost, after init the smaller images are still grayed out, but when I then switch the image to be displayed everything works as expected. Close enough for my user base  :))