Problem with SimpleJMEApplet's "getRootNode"

Hello!



I need urgently somebody helps me…



I'm trying to write a JME applet. To acess the Scenegraph's rootNode, we have to do it through getRootNode() method. The problem is that when I call this method, I get this exception:



java.lang.NullPointerException

        at com.jmex.awt.applet.SimpleJMEApplet.getRootNode(SimpleJMEApplet.java:248)

        at teste.CSG.init(CSG.java:135)

        at sun.applet.AppletPanel.run(AppletPanel.java:424)

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



Where teste.CSG.java extends SimpleJMEApplet type.



In init() I simply call getRootNode():



void init()

{

      Node rootNode = getRootNode();

}



I'm confused because I have made an applet with a call to this method run once.  :?



Could anyone help me, please?

Thanks! :slight_smile:


247    public Node getRootNode() {
248        return impl.getRootNode();
249    }



'impl' is null.

Its initilized in SimpleJMEApplet.init():158.

So i guess you you have overridden init() and didn't call super.init().
Core-Dump said:


247    public Node getRootNode() {
248        return impl.getRootNode();
249    }



'impl' is null.

Its initilized in SimpleJMEApplet.init():158.

So i guess you you have overridden init() and didn't call super.init().


Core-Dump, you're my saviour in jMonkey issues hehe

Thanks a lot!  :D

You can als use SimpleApplet which is more like SimpleGame.