Code Snippet of the week

public   void clearTable(JTable table)
{
int numRows = table.getRowCount();
int numCols = table.getColumnCount();
javax.swing.table.TableModel model = table.getModel();

for (int i=0; i < numRows; i++)
{
for (int j=0; j < numCols; j++)
{
model.setValueAt(null, i, j);
}
}
}

By http://naijadukes.net/jand/index.php?action=profile;u=11

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: