Reopening a screen with a ListBox

I just updated my svn to the latest version of jme3. I have a screen that contains a ListBox. When I try to launch the screen a second time using Nifty.goToScreen(), I get a NullPointerException. The funny thing is it only happens if I launch it the second time, it works fine when it is launched the first time. This behavior is new as it was working before I updated my svn.

When I switched to a DropDownBox, everything works as expected.

The specific error is:


SEVERE: Uncaught exception thrown in Thread[main,5,main]


at de.lessvoid.nifty.controls.listbox.ListBoxControl.applyWidthConstraints(

at de.lessvoid.nifty.controls.listbox.ListBoxControl.ensureWidthConstraints(

at de.lessvoid.nifty.controls.listbox.ListBoxControl.display(

at de.lessvoid.nifty.controls.listbox.ListBoxImpl.updateView(

at de.lessvoid.nifty.controls.listbox.ListBoxImpl.changeSelectionMode(

at de.lessvoid.nifty.controls.listbox.ListBoxControl.initSelectionMode(

at de.lessvoid.nifty.controls.listbox.ListBoxControl.bind(

at de.lessvoid.nifty.controls.NiftyInputControl.bindControl(

at de.lessvoid.nifty.elements.Element.bindControls(

at de.lessvoid.nifty.elements.Element.bindControls(

at de.lessvoid.nifty.elements.Element.bindControls(

at de.lessvoid.nifty.screen.Screen.bindControls(

at de.lessvoid.nifty.screen.Screen.startScreen(

at de.lessvoid.nifty.Nifty.gotoScreenInternal(

at de.lessvoid.nifty.Nifty.access$200(

at de.lessvoid.nifty.Nifty$1.perform(

at de.lessvoid.nifty.screen.Screen$EndScreenEndNotify.perform(

at de.lessvoid.nifty.screen.Screen$LocalEndNotify.perform(

at de.lessvoid.nifty.screen.Screen.startLayers(

at de.lessvoid.nifty.screen.Screen.endScreen(

at de.lessvoid.nifty.Nifty.gotoScreen(


at test.nifty.Game.main(


I will check this later … now I need to go to work (I’m already late xD)

Yes, that’s a bug and it gave me headaches for the last 48 hours or so. I think I have found the problem tho. Some of the other new controls had problems too. This will now lead to a number of changes inside of Nifty which are not yet commited because I want to make sure that I don’t break anything. I’ll expect the change to be ready for svn tommorow evening (in my timezone that is :slight_smile: ) or next weekend. This will fix your ListBox issue here as weil (and some other problems too).

Just want to give you an update that the issue is not forgotten (… instead it’s top priority because it’s really a show-stopper for 1.3)

1 Like

Awesome @void! Thanks for your hard work. The nifty library is looking pretty good.

I wrote a couple of tutorials on Nifty GUI, based on the *builder classes for UI creation as well as 1.3 controls. I would like some comments as I don’t want to use it in the wrong way. If you have time, please take a look at and scroll down to “Part III, Lesson 4”.

1 Like

I’ve commited everything. The next Nifty (!) nightly build should solve that issue.

@batkid: The tutorials look pretty great! :slight_smile: Maybe add a couple of screenshots too? Besides that I can’t spot any mistakes. Nice work!

(Maybe you can help improving the Nifty wiki at too? :D)

Thanks @void256. Do you know when the snapshot will be incorporated into the jME3 svn? I just updated and the fix is not there yet.

Let me know if you have any specific tutorials in mind that you would like me to help with.

Hopefully when Nifty 1.3 is done! I’m currently mainly fixing issues that are reported and the only missing feature that is scheduled is a radiobutton.

If you want to help with the Nifty wiki as well, then I’ll need your username. The more people helping the better :slight_smile:

With bugs getting fixed so quickly we might as well just grab nifty from SVN and use that for each of the jME3 nightly builds :slight_smile:

I’m currently mainly fixing issues that are reported and the only missing feature that is scheduled is a radiobutton.


Cheap RS Gold

Buy Runescape Gold

World of Warcraft Items

Just updated to the latest svn of jME3 and nifty is now working great. Thanks!

One question: how do you turn off the logging output? I tried:




but it doesn’t work. All the INFO level messages are still being printed out.