JME with Swing GUI: java.lang.IllegalStateException: Scene graph is not properly updated for renderi

Hi everyone!

I built a very simple GUI for a “game” in JME. I just want to choose a model, turn it, give it a name. (It’s supposed to be some kind of character creation like in MMORPGs.) The Problem is, I get an exception a lot. It’s very weird, because sometimes it happens at the first click, sometimes it happens after lots of clicks and sometimes… after a medium amount of clicks. :wink: Does anybody know why this is happening and how to solve it?

The exception im getting (when I’m getting it while changing the name its “Gui Node”, else it’s “Root Node”):

Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalStateException: Scene graph is not properly updated for rendering.

Make sure scene graph state was not changed after

rootNode.updateGeometricState() call.

Problem spatial name: Gui Node

at com.jme3.scene.Spatial.checkCulling(

at com.jme3.renderer.RenderManager.renderScene(

at com.jme3.renderer.RenderManager.renderViewPort(

at com.jme3.renderer.RenderManager.render(


at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(

at com.jme3.system.lwjgl.LwjglCanvas.runLoop(


at Source)

My code (not all of it, but the most important):


final JTextField nameField = new JTextField("");

nameField.setBounds(860, 10, 140, 20);

nameField.addActionListener(new ActionListener() {


public void actionPerformed(ActionEvent e) {

BitmapText name = (BitmapText) canvasApplication.getGuiNode().getChild(0);


float lineWidth = 0f;

if (name != null) lineWidth = name.getLineWidth();

name.setLocalTranslation(400-(lineWidth/2), 600, 0);





You cannot modify the scene graph outside the rendering thread.

You’re doing many kinds of modifications in actionPerformed, which runs in the EDT, this is not allowed.

Use the Callable class and submit operations to be executed on the rendering thread using Application.enqueue() method.

1 Like

Wow! Thank you so much! With the enqueue() method it didn’t crash at all! Great! :slight_smile: