title: Not able to get the correct row from a JTable after Sorting it (Swing)
body: <p>I got an AbstractTableModel, like this:</p>
  
  <pre><code>public class TableModelClienteFornecedor extends AbstractTableModel {
  
      private List&lt;ClienteFornecedorDTO&gt; linhas;
      private String[] colunas = new String[]{"Nome", "Conta"};
  
      public TableModelClienteFornecedor() {
          linhas = new ArrayList&lt;&gt;();
      }
  
      @Override
      public int getRowCount() {
          return linhas.size();
      }
  
      @Override
      public int getColumnCount() {
          return colunas.length;
      }
  
      @Override
      public String getColumnName(int column) {
          return colunas[column];
      }
  
       @Override
      public Class getColumnClass(int column) {
           return (getValueAt(0, column).getClass());        
      }
  
      @Override
      public Object getValueAt(int rowIndex, int columnIndex) {
          ClienteFornecedorDTO cf = linhas.get(rowIndex);
          switch (columnIndex) {
              case 0:
                  return cf.getNome();
  
              case 1:
                  return cf.getConta();
  
              default:
                  throw new IndexOutOfBoundsException("Coluna incorreta");
          }
      }
  
      public void clear(JTable table) {
          table.setRowSorter(null);
          int indiceAntigo = this.getRowCount();
          linhas.clear();
          int indiceNovo = this.getRowCount();
          this.fireTableRowsDeleted(indiceAntigo, indiceNovo);
      }
  
      public boolean isEmpty() {
          return linhas.isEmpty();
      }
  
      public void add(ClienteFornecedorDTO cf) {
          linhas.add(cf);
          int index = this.getRowCount();
          fireTableRowsInserted(index, index);
      }
  
      public void addList(List&lt;ClienteFornecedorDTO&gt; list, JTable table) {
          int tamanhoAntigo = this.getRowCount();
          linhas.addAll(list);
          int tamanhoNovo = this.getRowCount() - 1;
          this.fireTableRowsInserted(tamanhoAntigo, tamanhoNovo);      
          table.setAutoCreateRowSorter(true);        
      }
  
      public ClienteFornecedorDTO get(int i) {
          return linhas.get(i);
      }
  }
  </code></pre>
  
  <p>And the code below works ok to fill the my Jtable with data:</p>
  
  <pre><code>private void realizarBusca(String nome) {
  
      IContaDAO dao = new ContaDAO();
      boolean isFornecedor = radioFornecedor.isSelected();
      List&lt;ClienteFornecedorDTO&gt; retorno =
           dao.retornaContaClienteFornecedor(isFornecedor, nome);
      tableModelClienteFornecedor.clear();
      tableModelClienteFornecedor.addList(retorno, tableClienteFornecedor);
      tableClienteFornecedor.updateUI();
  }
  </code></pre>
  
  <p>Everything's working fine to me, and when I sort my Jtable visibily it's ok too, the problem is when I click on a specific row from my Jtable after I sorted it, the row it's not updated. </p>
  
  <p>Anyone can help me with that?
  I would appreciate, 'cause I'm on it since yesterday and still wasn't able to find a way to solve it.</p>