void (ActionEvent e) { if (myTable.isEditing()) return; int[] rows = myTable.getSelectedRows(); if (rows.length > 0) { boolean valueToBeSet = false; for (int row : rows) { if (!myCheckedMarks[row]) { valueToBeSet = true; break; } } for (int row : rows) { myCheckedMarks[row] = valueToBeSet; } myTableModel.fireTableRowsUpdated(rows[0], rows[rows.length - 1]); TableUtil.selectRows(myTable, rows); } }