title: Java Swing JTable; Right Click Menu (How do I get it to "select" aka highlight the row)
body: <p>Short: I need a "right-click event" to highlight the cell row.  </p>
  
  <p>I am using a JTable inside a ScrollPane in Java Swing (Netbeans Matisse).  I have a MouseClicked event listener on the JTable that does the following:</p>
  
  <pre><code>if (evt.getButton() == java.awt.event.MouseEvent.BUTTON3) {
            System.out.println("Right Click");
            JPopUpMenu.show(myJTable, evt.getX(), evt.getY())
  }
  </code></pre>
  
  <p>The problem is... whenever I execute a right click on the JTable, the row isn't highlighted (I set the selection to rows only btw).  I have looked for several setSelected() functions but could not find a suitable one.  By default, left clicking automatically highlights the row.  How do I set it up for right clicks?</p>