AwtPanel : Framebuffer doesn't have any renderbuffers attached

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]
java.lang.IllegalStateException: Framebuffer doesn’t have any renderbuffers attached.
at com.jme3.renderer.lwjgl.LwjglRenderer.checkFrameBufferError(LwjglRenderer.java:1317)
at com.jme3.renderer.lwjgl.LwjglRenderer.setFrameBuffer(LwjglRenderer.java:1594)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:961)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1035)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:251)
at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:188)
at com.jme3.system.awt.AwtPanelsContext.access$100(AwtPanelsContext.java:44)
at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:68)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:125)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:151)
at java.lang.Thread.run(Thread.java:724)[/java]

I tried running the TestAwtPanels example directly, and this time I faced another error :

[java]

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 !

TestAwtPanels always gives an exception when run from the test chooser because somebody rewrote TestChooser.java to bypass the test’s main() method. In my opinion, this is a bug in TestChooser.

When I run TestAwtPanels directly it usually works, however there is a race condition in the 3.0.9 version of TestAwtPanels.java which seems to be more serious on some platforms than on others.

For more info about the race condition see:

http://hub.jmonkeyengine.org/forum/topic/testawtpanels-gives-a-nullpointerexception/

Please get the corrected TestAwtPanels.java from GitHub ‘master’ branch and try that.

Hello sgold, and thanks for your answer.

I ran the TestAwtPanels directly, without the TestChooser, so I didn’t had the problem you write with it. I also saw the possible race condition in the TestAwtPanels (between the jme3 init and the swing invokeLater thread), so in my game I made sure to properly prevent it.

I tried to update my graphic card driver, without much hope because the last avalaible driver was quite old and I had the previous one (released 1 month before the last one)… and… it worked !

So basically, it was a driver problem. Sorry to have bothered you, and thanks for this wonderfull framework that is jme3, and for this great community (I very often find answers to problems I stumble upon on this forum) !

1 Like