Swing Canvas

Hello,



I use the tutorial “JME3 Canvas in a Swing GUI”

but how to use JButton over the canvas?





Thank you

You cannot.

Only if you use AWT panel instead, see TestAwtPanels

I use to use the Swing GUI approach when my game was on jME2. I really recommend switching to NiftyGUI. It’s very easy to integrate and fun to use! NiftyGUI

@normen
That is not true that a Swing component cannot be used over the canvas.
This can be easily done by disabling the window layout manager by calling
setLayout(null) on the containing window and manually positioning and scaling the elements.
@Pandaemonium
The NIfty GUI may be fun to use but it’s not as flexible as swing and not so well documented.