GLCanvas problem

Hello,
I am developing an application using JOGL. In SDI format, everything works fine, all threads are terminated once the application is closed.
But if i try to run the application in MDI mode by using JInternalFrames, closing the JInternalFrame container for the GLCanvas does nothing to the GLCanvas screen and the canvas retains the last image displayed and stays on the screen. I am posting the screen shots, as i cannot post the code. Any help regarding the reason as to why this might be happening is welcome.

  1. This is the screen shot with the 2 internal frames open. The darker frame is the one containing the GLCanvas.

    http://thumbnails.imajr.com/screen1_459811.JPG

  2. This the screen shot after closing the internal frame of the GLCanvas

    http://thumbnails.imajr.com/screen2_459812.JPG

Now here is the hierarchy in which GLCanvas has been added
JFrame
JDesktopPane
JInternalFrame
JPanel
GLCanvas

I hav tried catching the JINternalFrameEvent and tried removing everything from the JFrame, but the canvas still sticks.

Problem 2
I know that GLCanvas is a heavy weight component and it will overlap all light weight components, is there a way in which this problem can be avoided, so that if some light weight components are behind the canvas, they are displayed normally.

I would advice using a GLJPanel instead. It will be slower, but doesn’t suffer from this heavy-/lightweight incompatibility. Also the GLJPanel can be accellerated by activating the Java2D OpenGL pipeline in Java 1.6. See http://www.java-gaming.org/forums/index.php?topic=15101.msg120015#msg120015 for an example.

unfortunately i am stuck with jdk1.5 and cannot migrate to 1.6. How slow will be GLJpanel approximately ?
Is there any other alternative besides using GLJapnel?
Thanks for your reply

Don’t know. It depends. There is a constant overhead with copying the accellerated OpenGL rendering to main memory and feeding it back into the swing rendering pipeline. So the more complex the GLScene, the less noticable the performance difference.

another question in this series of questions.
i have been able to resolve the heavy weight overlap over light weight components. but when i destroy the screen in a multi tab sceen, the underlying GLCanvas screen stays with the last drawing rendered, even though i am explicitly using these 2 methods.
glcanvas.getcontext().release();
glcanvas.getcontext().destroy();

Is there nething else i need to destroy ? May be release the textures binded ? Any hint or pointers please ?

Have you explicitly removed the GLCanvas from its parent? That might help because it would call removeNotify(), which does some extra clean up for GLCanvas I believe

yes i have tried that also and it doesn’t work.