Example usage for javax.swing.table DefaultTableModel fireTableRowsDeleted

List of usage examples for javax.swing.table DefaultTableModel fireTableRowsDeleted

Introduction

In this page you can find the example usage for javax.swing.table DefaultTableModel fireTableRowsDeleted.

Prototype

public void fireTableRowsDeleted(int firstRow, int lastRow) 

Source Link

Document

Notifies all listeners that rows in the range [firstRow, lastRow], inclusive, have been deleted.

Usage

From source file:com.ftb2om2.view.MultiplePane.java

private void removeDifficultyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeDifficultyActionPerformed
    int[] rows = difficultyTable.getSelectedRows();

    DefaultTableModel model = (DefaultTableModel) difficultyTable.getModel();
    Arrays.sort(rows);//from   w  w w .  ja va 2 s .c  om
    for (int i = rows.length - 1; i >= 0; i--) {
        model.removeRow(rows[i]);
        model.fireTableRowsDeleted(rows[i], rows[i]);
    }
}