Painting an image on the backbuffer

We have a JME inside a JFrame and we want to paint an image in one of its corners. We have tried with a Panel inside a JMEDesktop and we can't because we don't use an InputHandler. How can we do it using the backbuffer? is there any other possibilitty?



Thank you!.

ortho textured quad?

Or perhaps make use of the glass pane?

Where can I see an example?

We create the JMEDesktop like this:



JMEDesktop iconDesktop = new JMEDesktop("iconDesktop", 265, 300, null);



I know the problem is caused by the InputHandler which is null but we have used a JMEDesktop created in this way in a SimpleGame and we haven't had any problem. However, if we use the JMEDesktop  inside a JFrame, we get the following exceptions:



java.lang.IllegalStateException: Display must be created.

at org.lwjgl.input.Mouse.create(Mouse.java:280)

at com.jme.input.lwjgl.LWJGLMouseInput.<init>(Unknown Source)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at com.jme.input.MouseInput.get(Unknown Source)

at com.jme.input.mouse.MouseInputHandlerDevice.createTriggers(Unknown Source)

at com.jme.input.InputHandler.addAction(Unknown Source)

at com.jmex.awt.swingui.JMEDesktop.setupDefaultInputBindings(Unknown Source)

at com.jmex.awt.swingui.JMEDesktop.setup(Unknown Source)

at com.jmex.awt.swingui.JMEDesktop.<init>(Unknown Source)

at com.jmex.awt.swingui.JMEDesktop.<init>(Unknown Source)

at es.eucm.eadventure3d.editor.gui.tdrpanel.TDRIconJMEDesktop.<init>(TDRIconJMEDesktop.java:33)

at es.eucm.eadventure3d.editor.gui.tdrpanel.tdractions.LoadIcon.simpleRun(LoadIcon.java:37)

at es.eucm.eadventure3d.editor.gui.tdrpanel.tdractions.TDRAction.run(TDRAction.java:58)

at es.eucm.eadventure3d.editor.gui.tdrpanel.TDRController.runAllActions(TDRController.java:104)

at es.eucm.eadventure3d.editor.gui.tdrpanel.TDRenderer.simpleUpdate(TDRenderer.java:174)

at com.jmex.awt.SimpleCanvasImpl.doUpdate(Unknown Source)

at com.jmex.awt.lwjgl.LWJGLCanvas.paintGL(Unknown Source)

at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:308)

at org.lwjgl.opengl.AWTGLCanvas.update(AWTGLCanvas.java:339)

at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)

at sun.awt.RepaintArea.paint(RepaintArea.java:216)

at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:301)

at java.awt.Component.dispatchEventImpl(Component.java:4486)

at java.awt.Component.dispatchEvent(Component.java:4240)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

19-feb-2008 18:26:31 com.jme.input.lwjgl.LWJGLKeyInput <init>

You could certainly create a DummyDisplay, but I am not sure it would help you with this problem, since you really need to render things.