Here you can find the source of deleteSelectedRows(JTable table)
public static void deleteSelectedRows(JTable table)
//package com.java2s; //License from project: Apache License import javax.swing.*; import javax.swing.table.DefaultTableModel; public class Main { public static void deleteSelectedRows(JTable table) { DefaultTableModel model = (DefaultTableModel) table.getModel(); int[] rows = table.getSelectedRows(); for (int rowIndex = 0; rowIndex < rows.length; rowIndex++) { model.removeRow(rows[rowIndex] - rowIndex); }// w w w . j a v a 2s. co m } }