LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Evil-Devil on May 11, 2005, 17:22:06

Title: Problem with AWTGLCanvas
Post by: Evil-Devil on May 11, 2005, 17:22:06
Hi, i have a little? problem with the AWTGLCanvas.

As you can see on the pictues, the canvas is allways the most top element...

(http://home.pages.at/evil-devil/Bubble_Ed_Tex_Error_1.png)
(http://home.pages.at/evil-devil/Bubble_Ed_Tex_Error_2.png)

The problem seen on picture 2 i allready solved, but the that on picture 1 is still there. How can i made it, that other Swing/AWT Element are displayed on the canvas, and not behind?

The problem encouters on (J)Frames and expecially on JInternalFrames

please help me
Title: Problem with AWTGLCanvas
Post by: princec on May 11, 2005, 17:27:58
Basically - you can't. AWTGLCanvas is a heavyweight peered AWT component, and like all such components, cannot be mixed with Swing's rendering hierarchy. Instead you need to do lots of cunning trickery to get it to behave, which is waaaay beyond the scope of LWJGL ;)

Cas :)
Title: Problem with AWTGLCanvas
Post by: Evil-Devil on May 11, 2005, 17:49:07
Hmm, ok. And when i would use the odd headyweight AWT Elements?

Because i need a GLCanvas for my LevelEditor and TextureBrowser...
Title: Problem with AWTGLCanvas
Post by: princec on May 11, 2005, 19:08:56
The solution is horribly simple :) Just design your GUI so that no components overlap it!

Cas :)
Title: Problem with AWTGLCanvas
Post by: tomb on May 11, 2005, 19:12:11
I think there is a way to make the swing popups (wich the combobox is) heavyweight. Ofcourse, I never use that crap so I wouldn't know how, but might be something you could look into.
Title: Problem with AWTGLCanvas
Post by: princec on May 11, 2005, 20:06:00
Easiest thing to do of course is to use AWT components.

Cas :)
Title: Problem with AWTGLCanvas
Post by: Orangy Tang on May 11, 2005, 23:39:26
http://java.sun.com/products/jfc/tsc/articles/mixing/

Unless you're using internal frames then you'll have no real issues - popups are the only things that'll overlap and the listed flag (near the bottom of the page) will fix that.
Title: Problem with AWTGLCanvas
Post by: Evil-Devil on May 13, 2005, 16:56:19
Thanx for the article link, i will see what i can use of it :)

For the moment i converted all my stuff to awt and it works, and only have the odd awt look and feeling ;D

/edit: yea, the article was really usefull :) Now i can use all the swing elements i need