PDA

View Full Version : JAVA JMenuitem is overrided by an OpenGl object



Mat
06-21-2002, 07:58 AM
Hi,

I have inserted my OpenGl GLAnimCanvas object in a Java interface. This interface has a menu like "file"... "Edit"... it's a MenuBar object.

When I open the menu with a big number of item, it is in contact with the opengl object.

The problem is that the opengl object hides the menu. The menu is behind the opengl object and the user can no more choose what he wants...

Do you know where the poblem could come from

Thanks a lot
Mat

GKW
06-21-2002, 01:17 PM
It is a conflict between heavy and lightwieght surfaces. You glcanvas is heavyweight and will always draw on top. Your menu is lightweight and will always be drawn over by the heavyweight canvas. There is a static call that makes menus heavyweight. I think it is along the lines of menu.setdefaultlightweight( false ). You might want to check out javagaming.org for quicker help. There is an article on Sun's website that explains heavy/light weight better than I can.

Mat
06-24-2002, 02:03 AM
Thanks,

I will try to find what I can... I know where it comes from now.

Mat

Mat
06-24-2002, 04:34 AM
it seems that I have to use a swing component.. because GLAnimCanvas is a AWT component... and that what makes it heavy...

Mat