HelloInput

Hello,



I have this message when I use JButton



GRAVE Application 11:41:24 Uncaught exception thrown in Thread[LWJGL Renderer Thread,6,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: Root Node

at com.jme3.scene.Spatial.checkCulling(Spatial.java:229)

at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:508)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:712)

at com.jme3.renderer.RenderManager.render(RenderManager.java:742)

at jme3test.awt.TestAppStates.update(TestAppStates.java:290)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:146)

at com.jme3.system.lwjgl.LwjglCanvas.runLoop(LwjglCanvas.java:225)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:208)

at java.lang.Thread.run(Thread.java:662)

INFO 11:41:26 EDT: Sending re-init request…



// associer les actions aux bouton



Function JButton

DroiteButton.addActionListener(new ActionListener()

{

public void actionPerformed(ActionEvent u)

{

Vector3f v = app.cube1.getLocalTranslation();

app.cube1.setLocalTranslation(v.x - 0.25f, v.y, v.z);

}

});

Your modifying the scene graph in the AWT thread, not the opengl thread where modifications to the scene graph have to take place. Use this:



[java]Future fut = application.enqueue(new Callable() {

public Object call() throws Exception {

//this is where you modify your object, you can return a result value

return modifyObject();

}

});



//to retrieve return value (waits for call to finish, fire&forget otherwise):

fut.get();[/java]

Originally posted by normen in Troubleshooting – General group

it works, but only for 4 or 5 clicks

wierd