Java JTable Row Delete removeAllRows(JTable... tables)

Here you can find the source of removeAllRows(JTable... tables)

Description

remove All Rows

License

Open Source License

Declaration

public static void removeAllRows(JTable... tables) 

Method Source Code

//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);
    }
}

Related

  1. deleteAllRows(JTable table)
  2. deleteSelectedRows(JTable table)
  3. delSelectedRows(JTable table)
  4. removeAllRows(JTable table)
  5. removeAllRows(JTable table)
  6. removeAllRowsFromTable(DefaultTableModel model)
  7. removeRow(int index, JTable table)
  8. removeRow(JTable table, int row)
  9. removeRow(JTable table, int row)