List<T> () { final List<T> elements = new ArrayList<>(); int[] viewRows = myTable.getSelectedRows(); for (int viewRow : viewRows) { if (viewRow < 0) { continue; } int modelRow = myTable.convertRowIndexToModel(viewRow); elements.add(myTableModel.getElementAt(modelRow)); } return elements; }