How can I draw navigator button on glcanvas

hi, I want to make navigator button like upright corner in google earth program. I use java jogl. How can I do this.

Take a screenshot of google earth, photoshop out the navigator and use it as a texture in your program. That’s the easiest way :), but not the most flexible.

Look at the JOGL JGears demo…I think this effectively has what you want. It has an image overlayed on a GLJPanel, and you’d have to add the mouse listener to see if you are over the image when pressing a mouse button.

I know this is not a GLCanvas solution, but you might want to use GLJPanel instead.

Thanks I use GLJPANEL and I can add button on gljpanel. But I have layout problem because I resize the frame Mybutton keep its position but I want my button to relocation like google earth

If you are using the example in JGears and you are overriding the paintComponent() method then you need to do that relocation yourself. When you resize the panel you need a listener that tells you that you resized and so within the paintComponent() you need to call ‘getWidth()’ to get the width of the new expanded panel and use this width value to relocate your button.