I have a combo box that looks like this:
Code:
    
//Combo Box
JComboBox cboTestNum = new JComboBox();
cboTestNum.addItem("1");
cboTestNum.addItem("2");
cboTestNum.addItem("3");
cboTestNum.addItem("4");
cboTestNum.setSelectedIndex(0);
I put it on my panel and now I want to find out what item is selected and assign it to an integer variable...

All I get is Null Pointer problems...

How can I assign the selected item to a variable named test?
Code:
int test;
test = Integer.parseInt("" + cboTestNum.getSelectedItem());
is giving me errors...

Thanks!