ou can use setRowCount(int rowCount)
on you table dataModel.
which will sets the number of rows in the model. If the new size is greater than the current size, new rows are added to the end of the model If the new size is less than the current size, all rows at index rowCount and greater are discarded.
For Example:
DefaultTableModel dtm = (DefaultTableModel) tabel1.getModel();
dtm.setRowCount(100); // though I would use some variable here
tabel1.setModel(dtm);
Please find the explanation here.