Java examples for Swing:JTable Row
delete JTable Rows
//package com.java2s; import java.util.Arrays; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class Main { public static void deleteRows(JTable table, int[] rows) { if (rows == null) return; Arrays.sort(rows);/*from ww w . j av a 2s .c om*/ DefaultTableModel model = (DefaultTableModel) table.getModel(); for (int i = rows.length - 1; i >= 0; i--) { model.removeRow(rows[i]); } } }