I have this error when i try to add items in the JComboBox
incompatible types: ComboBox cannot be converted to String
This is my met
It is hard to be certain without knowing how combobox
is declared and at which line the Exception is being thrown...
My guess: combobox
is declared as a JComboBox that takes a String
and you the Exception is being thrown since a ComboBox
is being added instead of a String
.
Possible correction: declare the JComboBox to hold instances of ComboBox
:
private JComboBox combobox;