"layering" issue with swing application and JME in canvas mode

I’m having an issue where popup menus and thing like that in my swing application are getting drawn behind my jmonkey game runnining in canvas mode… Here’s a screenshot of the scenario (full combo box options are hidden behind the game): imgur link. This also happens with Jpopupmenus and things like that.

Is there any way to make sure that these menus/popups are drawn on top of the game?

Maybe relevant:
http://docs.oracle.com/javase/6/docs/api/javax/swing/JPopupMenu.html#setDefaultLightWeightPopupEnabled(boolean)

…with a better description of what it means “lightweight” versus “heavyweight” here:
http://docs.oracle.com/javase/6/docs/api/javax/swing/JPopupMenu.html#setLightWeightPopupEnabled(boolean)

That did the trick.

so I take it this means that the canvas is “heavyweight”? Just out of curiosity is it possible to make it lightweight?

@icamefromspace said: That did the trick.

so I take it this means that the canvas is “heavyweight”? Just out of curiosity is it possible to make it lightweight?

Swing is light-weight, meaning that all rendering is done to a buffered image and then painted to the screen. Native controls tend to be heavy weight (and AWT was, too) that gives them direct access to the screen. So the OpeGL window likes to be heavy weight because it can directly access the screen.

I think you can make a light-weight OpenGL window (not sure how but I’ve heard it mentioned) but the implication is that the image is then always rendered off screen first and then copied to the window. ie: even though it’s “light weight” it is actually less performant in this case.

There is really no down side to heavy weight popups if that’s all you are worried about. They take up a few more resources but it’s small potatoes compared to the rest of the app, generally.

My interest was more in curiosity than trying to improve anything anyway. (my thought being trying to create “consistency” within the application to prevent other problems down the line.

From how you describe it thought, even if it was possible it doesnt sound like something I’d ever want to do anyway. thanks for the info.

@icamefromspace said: My interest was more in curiosity than trying to improve anything anyway. (my thought being trying to create "consistency" within the application to prevent other problems down the line.

From how you describe it thought, even if it was possible it doesnt sound like something I’d ever want to do anyway. thanks for the info.

I guess a light weight canvas is useful for when your OpenGL must play nice with swing components in more advanced ways but not much else. The swing-related issues are the same with regular AWT components, too. Like if you put an AWT component into a JTabbedPane then you have to take special care and stuff.