Here you can find the source of removeAllRows(JTable... tables)
public static void removeAllRows(JTable... tables)
//package com.java2s; //License from project: Open Source License import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class Main { public static void removeAllRows(JTable... tables) { for (JTable table : tables) { DefaultTableModel model = (DefaultTableModel) table.getModel(); while (model.getRowCount() > 0) { model.removeRow(0);//from w ww .j a v a 2s . c om } } } public static void removeRow(JTable table, int row) { ((DefaultTableModel) table.getModel()).removeRow(row); } }