Head Up Display help needed

I’ve read several tutorials, but it’s not clear to me. I’ve made a menubar in the Nifty Editor. There are several images in the menubar. I don’t really know how to use the xml files.
This is the code I use to create the menubar (its a HUD actually)

[java]private void initHud() {

NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(
	assetManager, inputManager, audioRenderer, guiViewPort);

Nifty nifty = niftyDisplay.getNifty();
nifty.registerScreenController(new HudScreenController(this));
guiViewPort.addProcessor(niftyDisplay);

StartScreenState startScreenState = new StartScreenState(this);
stateManager.attach(startScreenState);

nifty.fromXml("Interface/main.xml", "main", startScreenState);

}
[/java]

And the screencontroller:
package game;

import com.jme3.app.SimpleApplication;
import com.jme3.app.state.AbstractAppState;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;

public class StartScreenState extends AbstractAppState implements ScreenController {

public StartScreenState(SimpleApplication app) {

}

public void bind(Nifty nifty, Screen screen) {
}

public void onStartScreen() {
}

public void onEndScreen() {
}

}

[/java]

The following things are not cleear for me:

  • I extend AbstractAppState in my StartScreenController, which means the HUD “is” an AppState.
  • I don’t know how to set the screencontroller.
And the screencontroller: [java]package game;

import com.jme3.app.SimpleApplication;
import com.jme3.app.state.AbstractAppState;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;

public class StartScreenState extends AbstractAppState implements ScreenController {

public StartScreenState(SimpleApplication app) {

}

public void bind(Nifty nifty, Screen screen) {
}

public void onStartScreen() {
}

public void onEndScreen() {
}

}

[/java]

I tend to do like this.
In the xml:
[java][/java]

And then in the application:
[java]nifty.getScreen(“gameScreen”).getScreenController();[/java]

The point is that by setting the controller in the xml, nifty creates an instance of it for you. It is then retrieved in java.