Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get selected item of combo box

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.

like image 584
ArK Avatar asked Jul 25 '11 10:07

ArK


People also ask

How do you get selected items from a ComboBox?

Getting the selected value Value of the selected item can be retrieved by using the SelectedValue property. It returns the property value bind to the ValueMember property. If the ValueMember is not initialized, it will return the value of the property bind to DisplayMember.

How do you display a value from a ComboBox in a textbox?

You can display the selected value from combobox to textbox by using the SelectedValuePath and SelectedValue property of WPF ComboBoxAdv control.

How do you delete something from a ComboBox?

To remove an itemCall the Remove or RemoveAt method to delete items. Remove has one argument that specifies the item to remove. RemoveAt removes the item with the specified index number.


1 Answers

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

like image 131
bharath Avatar answered Sep 20 '22 23:09

bharath