Not sure if this would thrown an exception like that but I noticed that you are declaring patterns as a String[] did you remember to declare that jComboBox was a JComboBox object?
like :
String[] patterns = { "S", "P", "1C", "Ps", "2C", "O", "W", "D", "K" };
JComboBox jComboBox = new JComboBox(patterns);
^
Yes i did declared that jComboBox as a JComboBox object. Don't know why but all kind of construktors like ...
1. JComboBox jComboBox = new JComboBox(patterns);
2. JList jList = new JList(listModel);
3. JScrollPane jScrollPane = new JScrollPane(jList);
... throw exeptions, i use jbeans maybe it referes to this matter :(
it throws exeption, but of course when running everything works properly
Hey,
I've had a similar problem today, and found a simple workaround...
String[] patterns = { "S", "P", "1C", "Ps", "2C", "O", "W", "D", "K" };
jComboBox = new JComboBox();
for(int i = 0; i < patterns.length; i++) {
jComboBox.addItem(patterns[i]);
}
Not perhaps the nicest way, but stopped the errors (although I was working in Eclipse). Hope that helps!