jTable - set all values to null

Hello,

how should I set all values in jTable to null after I have already set something in?

I have a jTable (sudoku 9x9) and I if I press "Clear" button i would like to clear all values (set them to "null")

I used this code:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

privatevoid TlacVycistiActionPerformed(java.awt.event.ActionEvent evt){

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

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

jTable1.setValueAt(null,i,j);

}

}

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

...the problem is that all of the cells are set to null except the last focused(clicked and set) one. I know that I should probably somehow "get rid" of the cell's focus but how to do it?

thanks for your advice...

Message was edited by:

mAdam

[1350 byte] By [mAdama] at [2007-11-26 17:54:07]
# 1
..uh..sorry I found it somewhere else here in forums...
mAdama at 2007-7-9 5:07:09 > top of Java-index,Desktop,Core GUI APIs...