From: Alban C. <aco...@wa...> - 2002-07-11 07:52:00
|
I=92m not an expert about Java GUI components, but this question is = often asked on the mailing list (and we should add it to the FAQ).=20 =20 Here is what I understood : =20 GLAnimCanvas is an awt and heavyweight component. JMenus are swing and lightweight components. Lightweight and heavyweight components don=92t mix properly, as heavyweight components are always draw on top of lightweight components. Thus, your menu opens behind your canvas. So if you want to be able to display a menu over your OpenGL stuff, you need to use a GLJPanel wich is lightweight. (It works, see the demo in swingDemos/GLSwingDemoApplet for an exemple). The drawback is the GLJPanel is not hardware accelerated, so you will lose performance over GLAnimCanvas. =20 You may have 2 other alternatives : - Use an awt menu wich should be heavyweight and should display properly (I am not sure about this, you have to make a test. If you do it, please let me know how it works). - Draw the menu yourself in OpenGL at the right place : see MiscDemos\tessdemo.html for an exemple. =20 Good day =20 Alban Cousini=E9 =20 =20 =20 =20 =20 |