Can't find nifty control Console

Hello

I have a server which uses the Nifty Console Control. In java I’m have got what the website has suggested and I keep getting null point exceptions.

[java]
@Override
public void simpleInitApp() {
loadsettings();

	// enable depth test and back-face culling for performance
    getRenderer().applyRenderState(RenderState.DEFAULT);

    guiNode.setQueueBucket(Bucket.Gui);

// Server myServer = null;
// System.out.println(portNumber());
// try {
// myServer = Network.createServer(gameName, gameVersion, portNumber(), portNumber());
// } catch (IOException e) {
// e.printStackTrace();
// }
// myServer.start();

    setDisplayStatView(false);
    setDisplayFps(false);
    
    niftydisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
    nifty = niftydisplay.getNifty();
    nifty.fromXml("interface.xml", "start");
    viewPort.addProcessor(niftydisplay);
    inputManager.setCursorVisible(true);
    
    niftyControl();
}

private void niftyControl() {
	Console console = screen.findNiftyControl("console", Console.class);
	
	console.output("Hello :)");
}

[/java]

And the xml is

So I would like to know how to fix the null pointer exception I’m getting

Sam

what is null?

Is your XML file in the Interface folder? if so it should be [java]“Interface/interface.xml”[/java]

Feb 11, 2013 8:29:24 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at Server.Run.niftyControl(Run.java:125)
at Server.Run.simpleInitApp(Run.java:121)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Unknown Source)

That’s what I get in console and the XML file is stored in the assets folder root.

Sam