Answers for "java swing jtable remove all rows"

0

java swing jtable remove all rows

DefaultTableModel dm = (DefaultTableModel) getModel();
int rowCount = dm.getRowCount();
//Remove rows one by one from the end of the table
for (int i = rowCount - 1; i >= 0; i--) {
    dm.removeRow(i);
}
Posted by: Guest on May-28-2021
0

java swing jtable remove all rows

DefaultTableModel dtm = (DefaultTableModel) jtMyTable.getModel();
dtm.setRowCount(0);
Posted by: Guest on May-28-2021

Browse Popular Code Answers by Language