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()
DefaultTableModel tm = (DefaultTableModel) tbl.getModel(); while(tbl.getRowCount() > 0) { ((DefaultTableModel) tbl.getModel()).removeRow(0); }