Originally posted by Aruneesh Salhotra:
I am extending DefaultTableModel, to implement the JTable, to display the records.
I am setting data through the method. But it sets the cells with the value "ERROR". I am not sure why it is doing so.
public void addData(Vector[] dataValues) {
int length = 0;
if (dataValues != null)
length = dataValues.length;
int index = 0;
while (index < length) {
if (dataValues[index] != null) {
Vector row = new Vector();
for (int i = 1; i <= 7; i++) {
row.add(dataValues[index].get(i));
}
this.addRow(row);
}
index++;
}
}
Hi
Maybe dataValues[index].get(i)) returns something strange.
I use this.setDataVector(Vector dataVector, Vector columnIdentifiers). It's just one call and runs fine.
Yupp