Why does my combobox selectedItem doesnt work? [closed]

Tags: ,



I don’t know why this line has an error

String selected = idCombo.GetItemText(idCombo.SelectedItem);

The compilation error is "SelectedItem cannot be resolved or is not a field"

Answer

You code looks like a C# code. In Java, you have to call idCombo.getSelectionModel().getSelectedItem() instead of idCombo.GetItemText(idCombo.SelectedItem).



Source: stackoverflow