Hello!
Can anybody please help me!
I'm creating a JTable.
JTable table = new JTable();
Vector rows = new Vector();
Vector columns = new Vector()
//specify column names
//add a couple of rows
table.setDataVector(rows, colums);
And I have a method
public Vector createClientElement(
String name, String surname, String birthdt, String email, String mobile){
Vector v = new Vector();
v.addElement(name);
v.addElement(surname);
v.addElement(birthdt);
v.addElement(email);
v.addElement(mobile);
return v;
}
This
Vector r = new Vector();
r = createClientElement(name, surname, birthdt, email, mobile);
rows.add(r);
table.addNotify();
works.
This
int selRow = table.getSelectedRow();
rows.remove(selRow);
table.addNotify();
works too.
But this
Vector r = new Vector();
r = createClientElement(name, surname, birthdt, email, mobile);
rows.set(r); // I even tried replacing "set" by removing and then adding an elenment at the same position.
table.addNotify();
does not.
Only after I click somewhere on the table the element is set.
What am I doing wrong?
Waiting for reply.......
Thank you very much!