N
newsguy
Hi All;
I'm having problems seting up a new Combo box model. My Box Model...
stateBoxModel = new DefaultComboBoxModel(new String[]{state1,state2});
int size;
size = stateBoxModel.getSize();
System.out.println("Size is " + size);
....
Which prints out 2 and I'm sure the state strings have something in them.
But when I use the model...
stateComboBox.setModel(stateBoxModel);
....
I get:
java.lang.NullPointerException
at javax.swing.JComboBox.setModel(JComboBox.java:289)
at Desktop_9.initComponents(Desktop_9.java:389) //this is the
stateComboBox.setModel(stateBoxModel);
at Desktop_9.<init>(Desktop_9.java:90) // initComponents();
at Desktop_9.main(Desktop_9.java:2596)// new Desktop_9().show();
Exception in thread "main"
So I'm not sure why the model is null
Thanks for your time.
I'm having problems seting up a new Combo box model. My Box Model...
stateBoxModel = new DefaultComboBoxModel(new String[]{state1,state2});
int size;
size = stateBoxModel.getSize();
System.out.println("Size is " + size);
....
Which prints out 2 and I'm sure the state strings have something in them.
But when I use the model...
stateComboBox.setModel(stateBoxModel);
....
I get:
java.lang.NullPointerException
at javax.swing.JComboBox.setModel(JComboBox.java:289)
at Desktop_9.initComponents(Desktop_9.java:389) //this is the
stateComboBox.setModel(stateBoxModel);
at Desktop_9.<init>(Desktop_9.java:90) // initComponents();
at Desktop_9.main(Desktop_9.java:2596)// new Desktop_9().show();
Exception in thread "main"
So I'm not sure why the model is null
Thanks for your time.