public void processKeyEvent(KeyEvent evt){
  if (evt.getKeyCode() == KeyEvent.VK_UP || evt.getKeyCode() == KeyEvent.VK_DOWN)   evt.consume();
  super.processKeyEvent(evt);
  if (dict != null) {
switch (evt.getID()) {
case KeyEvent.KEY_PRESSED:
switch (evt.getKeyCode()) {
case KeyEvent.VK_UP:
        if (popup != null)         entryList.decrementSelection();
 else         showPopup(dict.iterator());
      break;
case KeyEvent.VK_DOWN:
    if (popup != null)     entryList.incrementSelection();
 else     showPopup(dict.iterator());
  break;
case KeyEvent.VK_ESCAPE:
if (popup != null) {
  hidePopup();
  selectAll();
}
break;
}
break;
case KeyEvent.KEY_TYPED:
switch (evt.getKeyChar()) {
case KeyEvent.VK_ENTER:
break;
default :
autoCompleteInput();
}
}
}
}

public void processKeyEvent ( KeyEvent evt ) { if ( evt . getKeyCode ( ) == KeyEvent . VK_UP || evt . getKeyCode ( ) == KeyEvent . VK_DOWN ) evt . consume ( ) ; super . processKeyEvent ( evt ) ; if ( dict != null ) { switch ( evt . getID ( ) ) { case KeyEvent . KEY_PRESSED : switch ( evt . getKeyCode ( ) ) { case KeyEvent . VK_UP : if ( popup != null ) entryList . decrementSelection ( ) ; else showPopup ( dict . iterator ( ) ) ; break ; case KeyEvent . VK_DOWN : if ( popup != null ) entryList . incrementSelection ( ) ; else showPopup ( dict . iterator ( ) ) ; break ; case KeyEvent . VK_ESCAPE : if ( popup != null ) { hidePopup ( ) ; selectAll ( ) ; } break ; } break ; case KeyEvent . KEY_TYPED : switch ( evt . getKeyChar ( ) ) { case KeyEvent . VK_ENTER : break ; default : autoCompleteInput ( ) ; } } } }
forwards necessary events to the autocompletelist .
