Java JTable Row Delete removeRows(int[] selectedRows, final JTable successTable)

Here you can find the source of removeRows(int[] selectedRows, final JTable successTable)

Description

remove Rows

License

Apache License

Declaration

public static void removeRows(int[] selectedRows,
            final JTable successTable) 

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 removeRows(int[] selectedRows,
            final JTable successTable) {
        DefaultTableModel model = (DefaultTableModel) successTable
                .getModel();//from w  w  w. java2s.c om
        for (int i = selectedRows.length - 1; i > -1; i--) {
            model.removeRow(selectedRows[i]);
        }
    }
}

Related

  1. removeAllRows(JTable... tables)
  2. removeAllRowsFromTable(DefaultTableModel model)
  3. removeRow(int index, JTable table)
  4. removeRow(JTable table, int row)
  5. removeRow(JTable table, int row)