I have one part of my UI that should be “dynamic” (plugin-based), and so there is one screen that I need to build in Java. I first build it in XML, to get it to work. After I finished converting it to Java, and removed it from the XML file, it crashed with a NullPointerException. I narrowed it down to this simplistic test case.
nifty.addScreen("create", new ScreenBuilder("create").build(nifty));
That gives me:
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.NullPointerException at de.lessvoid.nifty.controls.dynamic.ScreenCreator.createScreen(ScreenCreator.java:60) at de.lessvoid.nifty.controls.dynamic.ScreenCreator.create(ScreenCreator.java:48) at de.lessvoid.nifty.builder.ScreenBuilder.build(ScreenBuilder.java:48) at com.blockwithme.client.ui.CreateController.setupScreen(CreateController.java:133) ...
What am I doing wrong? It looks like the example I got from here:
Laying Out the GUI in Java