@Override protected Object getElementAt(int index) { JTable table = (JTable) _component; if (isColumnSelectionAllowed(table)) { // column selection mode return getValueAt(table, getMainIndex(), index); } else if (isRowSelectionAllowed(table)) { // row selection mode return getValueAt(table, index, table.convertColumnIndexToView(getMainIndex())); } else if (isSearchSelectedRows()) { // search on multi columns int columnIndex = index % table.getColumnCount(); int modelIndex = table.convertColumnIndexToModel(columnIndex); boolean doNotSearch = true; for (int i : getSearchColumnIndices()) { if (i == modelIndex) { doNotSearch = false; } } if (doNotSearch) { return null; } int rowIndex = index / table.getColumnCount(); return getValueAt(table, rowIndex, columnIndex); } else { // cell selection allowed int columnIndex = index % table.getColumnCount(); int rowIndex = index / table.getColumnCount(); return getValueAt(table, rowIndex, columnIndex); } }