hi all
I am trying to create an array with a combobox so that when selected it can triversed through the array to get the selected courses also am trying to find out how does a combobox detect a change in state when selected.
I am getting some real errors that i dont understand. here is the codes that I used.
private void jButton_clearActionPerformed(java.awt.event.ActionEvent evt) {
jtxtstdID.setText("");
jtxtname.setText("");
jtxtLName.setText("");
jtxtphne.setText("");
jpass.setText("");
jtxtemail.setText("");
txtcalattendance.setText("");
DefaultTableModel dtm = (DefaultTableModel)jTab.getModel();
dtm.getDataVector().removeAllElements();
dtm.fireTableDataChanged();
}
public void loadCoursesComboBox(){
jBox1.setModel(this.model.getCoursesComboBoxModel());
}
public void ItemStateChanged(ItemEvent ie){
private JComboBox<String> coursesList[] = new JComboBox[6];
jBox1.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent ie) {
if(ie.getStateChange() == ItemEvent.SELECTED){
JComboBox jcb = (JComboBox)ie.getSource();
coursesList[0]= jcb.getSelectedItem().toString();
}
}
});
}


