public void cancelAutoCompletion(){
  if (inCompletion) {
    textField.setText(textBefore);
    textField.setCaretPosition(caretPosBefore);
    prevCompletion=null;
    prevCompletionIndex=0;
    inCompletion=false;
  }
}

public void cancelAutoCompletion ( ) { if ( inCompletion ) { textField . setText ( textBefore ) ; textField . setCaretPosition ( caretPosBefore ) ; prevCompletion = null ; prevCompletionIndex = 0 ; inCompletion = false ; } }
cancels the current completion , which means the state of the text is returned to what it was before completion and the info popup is closed if necessary .
