Java JTable Row Delete delSelectedRows(JTable table)

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

Description

del Selected Rows

License

Apache License

Declaration

@Deprecated
public static void delSelectedRows(JTable table) 

Method Source Code


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

import javax.swing.*;
import javax.swing.table.DefaultTableModel;

public class Main {

    @Deprecated
    public static void delSelectedRows(JTable table) {
        DefaultTableModel model = (DefaultTableModel) table.getModel();
        if (model == null)
            return;
        int selectedColumnCount = table.getSelectedRowCount();
        for (int i = 0; i < selectedColumnCount; i++) {
            model.removeRow(table.getSelectedRow());
        }//  w ww  .j a  va  2s. c  o m
    }
}

Related

  1. deleteAllRows(JTable table)
  2. deleteSelectedRows(JTable table)
  3. removeAllRows(JTable table)
  4. removeAllRows(JTable table)
  5. removeAllRows(JTable... tables)
  6. removeAllRowsFromTable(DefaultTableModel model)