List of utility methods to do JTable Row Delete
void | deleteAllRows(JTable table) delete All Rows DefaultTableModel defaultTableModel = (DefaultTableModel) table.getModel(); defaultTableModel.setRowCount(0); |
void | deleteSelectedRows(JTable table) delete Selected Rows DefaultTableModel model = (DefaultTableModel) table.getModel(); int[] rows = table.getSelectedRows(); for (int rowIndex = 0; rowIndex < rows.length; rowIndex++) { model.removeRow(rows[rowIndex] - rowIndex); |
void | delSelectedRows(JTable table) del Selected Rows DefaultTableModel model = (DefaultTableModel) table.getModel(); if (model == null) return; int selectedColumnCount = table.getSelectedRowCount(); for (int i = 0; i < selectedColumnCount; i++) { model.removeRow(table.getSelectedRow()); |
void | removeAllRows(JTable table) remove All Rows if (table.getModel().getRowCount() <= 0) return; TableModel model = table.getModel(); ((DefaultTableModel) model).getDataVector().removeAllElements(); ((DefaultTableModel) model).fireTableDataChanged(); TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(model); table.setRowSorter(sorter); sorter.setRowFilter(null); ... |
void | removeAllRows(JTable table) remove All Rows DefaultTableModel model = (DefaultTableModel) table.getModel(); for (int i = table.getRowCount() - 1; i > -1; i--) { model.removeRow(i); |
void | removeAllRows(JTable... tables) remove All Rows for (JTable table : tables) { DefaultTableModel model = (DefaultTableModel) table.getModel(); while (model.getRowCount() > 0) { model.removeRow(0); |
void | removeAllRowsFromTable(DefaultTableModel model) remove all existing rows from the table while (model.getRowCount() > 0) {
model.removeRow(0);
|
void | removeRow(int index, JTable table) Method removes row from table if (index < table.getRowCount())
((DefaultTableModel) table.getModel()).removeRow(index);
|
void | removeRow(JTable table, int row) remove Row DefaultTableModel model = (DefaultTableModel) table.getModel(); model.removeRow(row); |
void | removeRow(JTable table, int row) remove Row ((DefaultTableModel) table.getModel()).removeRow(row); |