title: Java Swing JTable select programmatically multiple rows
body: <p>I have a JTable with multiple rows and every row is presented via Point on a scatter plot. What I have to do is when a given point is selected on the scatter plot I have to associate this selection with selecting of the corresponding row in the JTable.</p>
  
  <p>I have an Integer that represents, which row I have to highlight.</p>
  
  <p>What I tried is:</p>
  
  <pre><code>    JTable table = new JTable();
  ...
  ...// a bit of code where I have populated the table
  ...
     table.setRowSelectionInterval(index1,index2);
  </code></pre>
  
  <p>So the problem here is that this method selects all rows in the given range [index1,index2]. I want to select for example rows 1,15,28,188 etc.</p>
  
  <p>How do you do that?</p>