Java JTable Row Delete removeAllRows(JTable table)

Here you can find the source of removeAllRows(JTable table)

Description

remove All Rows

License

Apache License

Declaration

public static void removeAllRows(JTable table) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.JTable;

import javax.swing.table.DefaultTableModel;

public class Main {
    public static void removeAllRows(JTable table) {
        DefaultTableModel model = (DefaultTableModel) table.getModel();
        for (int i = table.getRowCount() - 1; i > -1; i--) {
            model.removeRow(i);//from   w w w .  j a va  2 s .c o m
        }
    }
}

Related

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