I need to remove all the rows in my JTable.
I have tried both of the following:
/** * Removes all the rows in the table */ public void clearTable()
Something like this should work
DefaultTableModel model = (DefaultTableModel)this.getModel(); int rows = model.getRowCount(); for(int i = rows - 1; i >=0; i--) { model.removeRow(i); }