how to store selection actions of multiple comboBox in to Array

My array only store user's last comboBox action which is really weird.

Who could give some suggestion pls?

for (int j=0;j<i;j++){

Object index = comboBox[j].getSelectedItem();

checkList[j]=(String) index;

System.out.println("test "+(j+1)+" "+checkList[j]);

}

checkList[0]= (String) comboBox[0].getSelectedItem();

Besides anyone know how to make comboboxes within one column show different options?

try{

String thisLine;

ArrayList><String> arrayList=new ArrayList<String>();

FileReader fr=new FileReader(file);

BufferedReader br =new BufferedReader(fr);

i = 0;

while ((thisLine = br.readLine()) !=null){// while loop begins here

// split row and add it to table

arrayList.add(thisLine);

String row [] =null;

row = thisLine.split(";");

dtm.addRow(row);

answerList[i]=row[3];

//render collumns

TableColumn col = table.getColumnModel().getColumn(0);

col.getCellRenderer();

//Split answer options

TableColumn answer = table.getColumnModel().getColumn(1);

String temp [] =null;

temp = row[1].split("/");

//add options to ComboBox

comboBox[i]=new JComboBox();

comboBox[i].addItem(temp[0]);

comboBox[i].addItem(temp[1]);

comboBox[i].addItem(temp[2]);

answer.setCellEditor(new DefaultCellEditor(comboBox[i]));

//comboBox[i].addActionListener(new ComboBoxListener());

i++;

System.out.println("Q"+i+" Correct Answer: "+row[3]);

}

br.close();

}

catch (IOException e1){

System.err.println("Error: " + e1);

}...

Message was edited by:

karen577

[2746 byte] By [karen577a] at [2007-11-27 1:41:08]
# 1
Don't [url= http://forum.java.sun.com/thread.jspa?threadID=5162860&tstart=0]crosspost![/url]
CaptainMorgan08a at 2007-7-12 0:56:10 > top of Java-index,Java Essentials,Java Programming...
# 2
CROSSPOST: http://forum.java.sun.com/thread.jspa?threadID=5162860
DrLaszloJamfa at 2007-7-12 0:56:10 > top of Java-index,Java Essentials,Java Programming...