void () { myTable.stopEditing(); List<Item> items = new ArrayList<>(doGetItems()); final int[] rows = myTable.getSelectedRows(); for (int i = rows.length - 1; i >= 0; i--) { items.remove(rows[i]); } setItems(items); updateMessage(-1, null); if (!items.isEmpty()) { int index = Math.min(rows[0], items.size() - 1); myTable.getSelectionModel().addSelectionInterval(index, index); } }