private boolean checkAutoInsert()  {
       if (autoInsert && lastKeyPressedEvent != null) {
           // down in the last row triggers auto-insert
           if (prevRowIndex == (this.getRowCount()-1)  && (lastKeyPressedEvent.getKeyCode() == KeyEvent.VK_DOWN)) {
               this.invokeRowInsert();
               return true;
           // tab or enter in the last cell triggers auto-insert
           } else if (prevRowIndex == (this.getRowCount()-1) && (prevColumnIndex == this.getColumnCount()-1)
                   && (lastKeyPressedEvent.getKeyCode() == KeyEvent.VK_TAB ||
                       lastKeyPressedEvent.getKeyCode() == KeyEvent.VK_ENTER)){
               this.invokeRowInsert();
               return true;
           }
       }
       return false;
   }