Sign in to follow this  

[java] JOGL menu issue.

This topic is 3283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am unable to layer swing menus, objects, over my JOGL canvas. I came up with a sort of intermediate solution that is called by any event listener that handles a non-openGL call. Basically it replaces the openGL canvas with a jPanel with a picture of the openGL canvas, and despite the stupidity it works pretty well except for a slight flicker as the picture will contain the previous image before it was updated for a second before updating. My question is this: Is there a better way to handle this? if not, is there a way to get into the rendering function to get Java to paint the image onto the Panel BEFORE it shows it to prevent the flicker? I've tried various permuations of paintComponent, etc, but I can't seem to find where I can modify the paint order in order to get this to work.

Share this post


Link to post
Share on other sites
the issue that you're having probably comes from mixng heavy and light-weight components

since swing components are lightweight and the jogl canvas is heavy(afaik).

you could try:

using all heavyweight (awt) components
pausing your app and prevent a re-draw of the jogl canvas until your app is unpaused
develop an opengl gui (or find a library that already does)

Share this post


Link to post
Share on other sites
I briefly scanned the links provided and didn't see this mentioned, but JOGL already provides the GLJPanel class for compatibility with Swing applications. While this is the solution I ended up using for the software I work on, be warned that this class is one of the crankiest classes I've dealt with. Good luck!

Share this post


Link to post
Share on other sites
Quote:
Original post by tool_2046
I briefly scanned the links provided and didn't see this mentioned, but JOGL already provides the GLJPanel class for compatibility with Swing applications. While this is the solution I ended up using for the software I work on, be warned that this class is one of the crankiest classes I've dealt with. Good luck!


thanks tool, your help was most appreciated!~

Share this post


Link to post
Share on other sites

This topic is 3283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this