how to get selected item of combo box

ArK picture ArK · Jul 25, 2011 · Viewed 73.9k times · Source

i'm using lwuit with j2me . how to get combo box selected item or index? i found the function for setSelectedIndex but not for getting the selected.

Answer

bharath picture bharath · Jul 26, 2011

Use this code :

combobox.getSelectedIndex(); 

To return the current selected offset in the list.

combobox.getSelectedItem(); 

To return the current selected item in the list or null for no selection