title: Automatically selects other row of JTable
body: <p>I want to develop a billing system swing application,but i stuck at a place.I want after bill the JTable row selection <strong>moves to first row</strong> for next billing, but after submission the last or other row selection occur.Please help me...
  [After KeyPressed Event]
  The key binding is as follows..</p>
  
  <pre><code>InputMap im = cartTable.getInputMap();
      im.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Action.NextCell");
      im.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "Action.NextCell");
  
  ActionMap am = cartTable.getActionMap();
  am.put("Action.NextCell", new AbstractAction(){
  
      @Override
      public void actionPerformed(ActionEvent e) {
          int col = cartTable.getSelectedColumn();
          int row = cartTable.getSelectedRow();
  
          if(col==0 &amp;&amp; cartTable.getValueAt(row, col)==null){
              ProductListForm productList=new ProductListForm();
              productList.setVisible(true);
          }else if(col==1 &amp;&amp; ProductListForm.product.getName()!=null){
              setValueToTable();
          }else if(col==7){
              calculateValue();
          }else if(col==9){
              calculateTotal();
              row++;
              col=-1;
          }
          col++;
          cartTable.changeSelection(row, col, false, false);
          cartTable.editCellAt(row, col);
      }
  }); 
  </code></pre>
  
  <p>The bill submission code is this..</p>
  
  <pre><code>if(evt.getKeyCode()==KeyEvent.VK_PAGE_DOWN){
              JOptionPane.showMessageDialog(this, "Record Saved", "message", JOptionPane.OK_OPTION);
              savePurchaseDetails();
              saveStockDetails();
              resetPage();
              updateReturnTable();
              int result=JOptionPane.showConfirmDialog(this, "Do you want to print reciept?", "Print Confirmation", JOptionPane.YES_NO_OPTION);
              if(result==JOptionPane.YES_OPTION){
  
              }
              cartTable.changeSelection(0, 0, false, false);
          }
  </code></pre>