Setting up nifty controller in Java

Hey Guys,

I want to setup a nifty controller in java, but I cannot figure out how to correctly bind the gui to a panel. If I use this code:
[java]
final PanelBuilder pb = new PanelBuilder() { {
this.childLayoutCenter();
this.control( new ControlBuilder( “#TestBar”, “barBlue” ){
{
this.width( “400px”);
this.height( “20px”);
this.controller( new MyController(“Essential input argument”) );
}
});
this.x( x + “px” );
this.y( y + “px” );
this.width( “800px” );
this.height( “100px” );
}
};
[/java]
Then nifty instantiates a new instance of “MyController” and binds that to the panel. Alternatively I do this:
[java]
final PanelBuilder pb = new PanelBuilder() { {
this.childLayoutCenter();
this.controller( new MyController(“Essential input argument”) );
this.control( new ControlBuilder( “#TestBar”, “barBlue” ){
{
this.width( “400px”);
this.height( “20px”);
}
});
this.x( x + “px” );
this.y( y + “px” );
this.width( “800px” );
this.height( “100px” );
}
};
[/java]
And nifty does the same… Using this.[java]this.control( new ControlBuilder( “#TestBar”, “barBlue” )[/java] seems to be the only way to make use of my XML setup of the control, but [java]this.controller( new MyController(“Essential input argument”) );[/java] is the easiest way for me to configure a few input arguments.

Does anyone know a solution?

@nihal said: I want to setup a nifty controller in java, but I cannot figure out how to correctly bind the controller to a panel. If I use

Is there no way to edit a post anymore? I have been away for 6 months, the new forum layout is confusing me again… :confused:

its a current bug in the forum, you cant edit the initial post on a thread. i guess theyre still working on it.

until they do that. you can just append /edit to the end of your thread URL to get to the editing screen.