I’m making a little application using jMonkey Engine 3 along with Swing.
I read and used the wiki page JME3 Canvas in a Swing GUI. It worked very well, until I wanted to add a “chat” feature in Swing.
The chat consist of a JTextField to enter message. As described in this topic, the JmeCanvas seems to hold the focus once it get it and never release it. That means that if I click on the JTextField, it does not get the focus, so I cannot enter text from the keyboard.
I can switch to another window (another application), then click on the JTextField, this way it get the focus and I can enter text.
As suggested in the previously mentioned topic, I tried to use AwtPanel, following the TestAwtPanels example class, only to encounter an error :
java.lang.IllegalStateException: Framebuffer doesn’t have any renderbuffers attached.
I tried running the TestAwtPanels example directly, and this time I faced another error :
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x03ace0d0, pid=3332, tid=4280[/java]
If I comment out the two last lines of the example class (attaching panel2 to guiViewPort), I’m back to the “Framebuffer doesn’t have any renderbuffers attached.” error.
Any idea at what could trigger this error, and how I could solve it ?
I’m using a PC on Windows XP. The graphic card is only the one on my motherboard (Intel Q45/Q43 Express Chipset), and seems to support OpenGl 2.0, but not 2.1 (at least not fully)
All was working fine using JmeCanvasContext
I’m looking for solution to either :
make AwtCanvas works
Do not use AwtCanvas, but have focus work as intended. I read somewhere that it could be related to the JmeCanvas consuming all user input. If it is the case, what is the best way to let Swing manage the inputs ?
Thanks in advance !