JpopupMenu on canvas?

If I wanted to show a JPopupMenu object on canvasPeer.getComponent() (currently using JOGL, guess could be different if using other layers…). Can this be done? is the solution to use a UIWindow?

Currently, if try



JPopupMenu m = new JPopupMenu();
m.add( new JMenuItem("bla"));
m.show( canvasPeer.getComponent(), evt.getX(), evt.getY());

The canvas draws on top of the popup-menu (a problem I face sometimes with normal menus).

would appreaciate any direction,
pedro

JPopupMenu is a swing menu, so it’ll be lightweight. A Jogl canvas on the other hand is heavyweight, so will always be drawn on top. The simple workaround is to set

JPopupMenu.setDefaultLightWeightPopupEnabled(false);