How can I set the items of a jcombobox as an array, after initialization (I mean not with the constructor) ?
Initially I use the default constructor that adds no items in the combobox:
comboBox = new JComboBox();
And then I'd like to set the items by passing an array
String a[]={"a","b"};
but the only method for doing this seems to be setModel(ComboBoxModel)
So when I try doing the following, the compiler shrieks:
comboBox.setModel(a);
Is there maybe a way to convert from a string array to a ComboBoxModel ?
Thanks very much.