That error appears because you didn't specify a generic parameter for the JComboBox.

It's not strictly required (Java will default to Object which allows all objects, done for historical reasons),...