Swing Component above JOGL

hello,

i am trying to place a swing component (Batiks JSVGCanvas which extends from JComponent) above a JOGL window.

the problem is that it always seems to be below the JOGL canvas. i have already tried GLCanvas and GLJPanel as well as changing the order in which they are added to the parent frame. (java.awt.frame)

is there a possiblity to place a swing component above a JOGL-panel/window/component? thanks!

Have you tried setting component Z-order?

e.g. setComponentZOrder()

GLCanvas is a heavyweight component and is always rendered on top of any swing component. GLJPanel shouldn’t overdraw over its childs. (there is AFAIK also a JOGL demo available demonstrating the rendering of swing components over the GLJPanel)

Yes GLJPanel should work fine with this. I particulary remember a Sun demo where some panels where in foreground and background.

At least it works for me. I put the GLJPanel in null layout setLayout(null); and use setBounds() to set the position of the panel.

Note I use this instructions to refresh when components are added/removed

gljpanel.add(mycomponent);
mycomponent.addNotify();
mycomponent.validate();