Nifty: Changing the default displayItems size of a drop down list

I created a nifty DDL using java builder and this tutorial:

The tutorial mentions that the default displayItems size is 4. How can I increase it?

I checked the API for that class and I still can’ t figure it out: DropDown (Nifty Default Controls 1.3 API)

can anyone help?



The problem is, that DropDownBuilder does not expose the displayItems property with a dedicated method (missing feature really). You can work around it using the general method to set an attribute though:

[java]control(new DropDownBuilder(“dropDown”) {{
set(“displayItems”, “10”); // have to use the general set(key, value) method since there is no dedicated “displayItems” method

It would not be hard to add if you look at the source of DropDownBuilder:

1 Like

great! Thanks

Check this out: :smiley:

Nifty 1.4 will have that method :wink: