Using textfields in nifty popups

Can I use Textfields in nifty-popups?


Okay this problem is solved^^ .

But now I got another one. I have this popup with two Textfields and a button. When I click on the button I want to read out the text standing in the texfields. the problem is I can´t reference the Textfields:

[java]public void bind(Nifty nifty, Screen screen) {

this.nifty = nifty;

this.screen = screen;

name1 = nifty.findPopupByName(“popupNamen”).findControl(“textfeldSpieler1”, TextFieldControl.class);

name2 = nifty.findPopupByName(“popupNamen”).findControl(“textfeldSpieler2”, TextFieldControl.class);



when I start then I get this failure:

SCHWERWIEGEND: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]


at curlingxtreme.gui.MenuBildschirmController.bind(

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

at de.lessvoid.nifty.Nifty.gotoScreenInternal(

at de.lessvoid.nifty.Nifty.gotoScreen(

at de.lessvoid.nifty.Nifty.fromXml(

at curlingxtreme.CurlingXtreme.simpleInitApp(


at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(



it looks right :confused:

try to find out what exactly is null? does findPopupByName() returns null or does findControl() does not find the textfield?

did you check for any tippfehler? :wink:

uhm, wait! you call that in your bind() method? why is this? are you sure you get the same nifty instance that has created the popups before?