Not an answer to your question but as it looks like you’re just starting out with Nifty, be aware that its not really well liked any more and Lemur is probably a better bet for a new project.
In your code fragment, you appear to be adding the NiftyJmeDisplay scene processor to the main viewport. However, it’s possible to change the order in which the main scene and Nifty are rendered.
Viewports are generally rendered back-to-front. To render Nifty after the main scene, you’ll want to add its scene processor to a “post” viewport — one that’s rendered after the main scene.
In the jme3-examples project, this is usually done by adding to the GUI viewport, like so:
guiViewPort.addProcessor(niftyDisplay);
Here’s a code fragment that I use to create a custom “post” viewport and add the scene processor to it:
int height = cam.getHeight();
int width = cam.getWidth();
Camera niftyCam = new Camera(width, height);
ViewPort niftyView = renderManager.createPostView("NiftyGUI", niftyCam);
niftyView.addProcessor(niftyDisplay);