void (KeyEvent e) { int i = e.getKeyCode(); if (i == KeyEvent.VK_BACK_SPACE && getDocument().getLength() == 0) { e.consume(); return; } if ( i == KeyEvent.VK_ENTER || i == KeyEvent.VK_PAGE_UP || i == KeyEvent.VK_PAGE_DOWN || i == KeyEvent.VK_LEFT || i == KeyEvent.VK_RIGHT ) { if (!isStickySearch()) { manageSearchPopup(null); } return; } if (i == KeyEvent.VK_ESCAPE) { hidePopup(); e.consume(); return; } if (isUpDownHomeEnd(i)) { e.consume(); return; } if (e.getID() == KeyEvent.KEY_TYPED && !UIUtil.isReallyTypedEvent(e)) { // Stuff like Ctrl+N / Ctrl+P is processed on KEY_PRESSED, and the subsequent KEY_TYPED screws it up. return; } super.processKeyEvent(e); if (!e.isConsumed() && getNavigationKeyCode(e) != 0) { // Some navigation action shortcuts aren't consumed by the field, e.g. if these are custom shortcuts the text field doesn't understand. e.consume(); } if (i == KeyEvent.VK_BACK_SPACE) { e.consume(); } }