title: Error when delete row from Jtable
body: <p>My Jtable have a listSelectionListener :</p>
  
  <pre><code>jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
  
          @Override
          public void valueChanged(ListSelectionEvent e) {
              System.out.println(jTable1.getValueAt(jTable1.getSelectedRow(), 0));
          }
      });
  </code></pre>
  
  <p>i create a button to delete all rows of Jtable with event:</p>
  
  <pre><code>for (int i =jTable1.getModel().getRowCount()-1; i &gt;=0 ; i--) {
          ((DefaultTableModel)jTable1.getModel()).removeRow(i);
      }
  </code></pre>
  
  <p>If i press the button without choosing any row ,there is no error but when i choose a row then press the button i get this error:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1
  </code></pre>
  
  <p>This don't happen when table don't have ListSelectionListener.
  Where do i wrong?</p>
  
  <p>Thanks in advance for help with this. </p>