Here you can find the source of removeTableRows(DefaultTableModel model)
public static void removeTableRows(DefaultTableModel model)
//package com.java2s; //License from project: Open Source License import javax.swing.table.DefaultTableModel; public class Main { public static void removeTableRows(DefaultTableModel model) { if (model == null) { return; }/*from w w w . j a v a2 s .co m*/ int rows = model.getRowCount(); for (int i = rows - 1; i >= 0; i--) { model.removeRow(i); } } }