PDA

View Full Version : select a item in a ComboBox



Ceene
8 Sep 2011, 3:51 AM
Hey

I have a problem with my ComboBox. In my ComboBox are two rows and I would like to select manualy the second row. I tried it with comboBox.select(1) but it doesn't work.



privat

List<ComboMultiSign> getComboEintrag() {
List<ComboMultiSign> plants = new ArrayList<ComboMultiSign>();
plants.add(new ComboMultiSign("J", "Ja"));
plants.add(new ComboMultiSign("N", "Nein"));
return plants;
}










ListStore<ComboMultiSign> multi =
new ListStore<ComboMultiSign>();
multi.add(getComboEintrag());
cbMultiSign.setStore(multi);
cbMultiSign.select(1);


Where is my mistake?

sven
8 Sep 2011, 3:59 AM
cbMultiSign.setValue(cbMultiSign.getStore().getAt(1));

Ceene
8 Sep 2011, 4:14 AM
Thanks a lot. Wonderful.