Is there anyway to show Component on Canvas

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there anyway to show Component on Canvas

robbiezl
In my project I use GLCanvas instead of GLJPanel because of GLJPanel's lower performance.
I want to show toolbar component or panel component on GLCanvas, but I can not.

Is there anyway ? thanx!

sorry for my poor English.
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to show Component on Canvas

gouessej
Administrator
You can put your GLCanvas into a JPanel and this JPanel into a JFrame. Then, you can use a JInternalFrame to draw something above your GLCanvas. It works with a "recent" version of Java with a tough support of mixing heavyweight and lightweight components.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to show Component on Canvas

robbiezl
My GLCanvas is into a JPanel and this JPanel is in a JFrame.
I use JDK 1.6_u32 and I tried to use JInternalFrame ,but I found when I add JInternalFrame first, then add GLCanvas into JFrame ,the JInternalFrame can show above the GLCanvas.If I add the GLCanvas first,the JInternalFrame sometimes still below the GLCanvas.




Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to show Component on Canvas

gouessej
Administrator
It's better than nothing. I advise you to try on Mac too because I remember that there is a problem of Z order in this case.

On the long term, I would like to use a pure port of Swing to JOGL 2.0, based on NEWT, a bit like PureSwing. Such a project would be very time consuming and I would discuss a bit more about that with Sven and with other JogAmp users.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to show Component on Canvas

robbiezl
I try to user GlassPane to add some JComponent above GLCanvas,and it is ok on Win7.I do not know if it will have some z order problem when I change it to Linux or Mac.

if I user a pure Swing NEWT ,I have to change my project a lot.Can modify GLJPanel  efficient as the GLCanvas  may much better to me!

Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to show Component on Canvas

gouessej
Administrator
It's a very good idea. It should work under GNU Linux too.

If you used a reimplementation of Swing that would use only NEWT, you would have nothing to change except import clauses (javax.swing -> jogamp.swing) and even this change could be automatized by a script.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to show Component on Canvas

robbiezl
I will have a try to use the new NEWT.Thank u for ur help!
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to show Component on Canvas

gouessej
Administrator
robbiezl wrote
I will have a try to use the new NEWT.Thank u for ur help!
It's not yet ready, you will have to be very patient, it is still a project.
Julien Gouesse | Personal blog | Website