title: JTable : how to get selected cells?
body: <p>I have a JTable and its TableModel, it works well but what I want to do now is to get the selected cells of it. I thought of doing something like :</p>
  
  <pre><code>int rows = this.getTable().getRowCount();
  int columns = this.getTable().getColumnCount();
  for(int i = 0 ; i &lt; rows ; i++)
  {
      for(int j = 0 ; j &lt; columns ; j++)
      {
           if(table.getCell(i,j).isSelected() //...
      }
  }
  </code></pre>
  
  <p>But of course something like this doesn't exist. What should I do instead?</p>