help!!! set the jtable cell value is null

Dear all:

i want to clear all the cell and set it is null !!!

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

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

table.setValueAt(null,i,j);

}

}

it is work,but veru ineffeicency, and very slow in computer running!!

Have other method instead of it!!!

Thank you!!

[335 byte] By [chichiua] at [2007-10-2 23:22:30]
# 1

In the future, Swing related questions should be posted in the Swing forum.

You can create a new TableModel:

DefaultTableModel model = new DefaultTableModel(2000, 52);

table.setModel( model );

I don't know if getValueAt(...) will return a null value or an empty String.

Or maybe you should be using a SparseTableModel like in this example:

http://forum.java.sun.com/thread.jspa?forumID=57&threadID=596664

camickra at 2007-7-14 16:00:44 > top of Java-index,Java Essentials,Java Programming...