jME + Swing

Hi all! I have a question. I need to use jME in some visualisation project. I need run application within my swing GUI. So I should get jME renderer as a java.awt.Component or (better) javax.swing.JComponent. How can I do this?



Thanks.

Hi, you could refer to the tutorial : https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:swing_canvas?s[]=swing



and the post : http://hub.jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/embedd-jme3-into-swing/



and to deep inside the devil heart, you can look at the JMonkey Engine SDK in the SceneComposer Netbeans Module source code… and see the great job of @normen



++

2 Likes

Also due to Swing running in a different thread to the OpenGL thread you have to wrap calls so that they are called on the jME update loop, with app.enqueue(new Callable());



I refer you here for more info:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:multithreading

2 Likes