Java examples for Swing:JTable Row
remove All Rows from JTable
//package com.java2s; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class Main { /**// w w w .j a va 2s . c o m * * @param table */ public static void removeAllRows(JTable table) { DefaultTableModel model = (DefaultTableModel) table.getModel(); for (int row = 0; row < table.getRowCount(); row++) { model.removeRow(row); } } }