Skip to content
Advertisement

Why does my combobox selectedItem doesnt work? [closed]

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"

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement