Multiple Frames with JOGL, GLEventListener overides all Paint methods

Has anyone else experienced this? I have a basic JOGL display and I have a function call that creates a seperate frame where the user can adjust settings, like lighting, rotation speed, etc. I move this option frame off of the window where the jogl display is being drawn and I can manipulate the controls in the frame just fine. However, when I rotate an object in the jogl display frame the other frame flickers as if its own paint method is being intercepted by the GLEventListener I created. Will the GLEventListener intercept all painting methods for everything in an app? I even overrode the paint method for the option frame and put a println statement so that I could see when it paints itself, and it’s not being called. If I comment out the display() method call then it’s ok.

Thanks for any help with this confusing issue…

Bolt

One correction. Even if I comment out the display() method call, I get the same problem :frowning:

One thing I did notice was that if the “parent” frame with the jogl display is minimized then the option frame draws fine. Also I just wanted clarify what the “flickering” was. When the option frame is first brought up the default settings are displayed. Once play with these default settings and then rotate in the jogl display, then option frame then oscillates between the initial frame display and the new updated values. When it is “stuck” displaying the init state it also appears not to accept any input at all. If I rotate enough on the jogl display then I can get it to the right display (in between the flickering) and then it’ll accept input.

So I was able to successfuly implement a new frame, however I had to use a GLJPanel to do this. Most likely because of the heavyweight threading involved with a GLCanvas. However, can there be a way to do this with a GLCanvas?

Okay, I finally got it working. What you have to do is set the frame’s z-order (the frame that contains the jogl display) to be the lowest so it will be the last to draw.

I thought the previous fix worked (z-order) but it didn’t :frowning: As it stands right now, the only way I can get external frames to work within the same app that uses a jogl display is to use a GLJPanel.

Okay, I made a HUGE mistake. Make sure when you add the GLCanvas to a frame or container you add it to the contentpane… hehe

I was doing this and it made me have problems: demo.add(myGLCanvas);
where demo was a JFrame.

instead do this: demo.getContentPane().add(myGLCanvas);

for some this may be overly obvious, but it wasn’t to me.

doesn’t it feel like sometimes you are just having a conversation with yourself?

sigh…though sometimes talking to one’s self is more enjoyable and sometimes more fruitful - glad you found the problem.

yeah, loud echo here…here…here…here…here