if (comboBox.getModel().getSize() != 0 && comboBox.isEnabled()) { if (! isNavigationKey(e.getKeyCode())) { if (! comboBox.isEditable()) if (comboBox.selectWithKeyChar(e.getKeyChar())) e.consume(); } else { if (e.getKeyCode() == KeyEvent.VK_UP && comboBox.isPopupVisible()) selectPreviousPossibleValue(); else if (e.getKeyCode() == KeyEvent.VK_DOWN) { if (comboBox.isPopupVisible()) selectNextPossibleValue(); else comboBox.showPopup(); } else if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_ESCAPE) popup.hide(); } }
    public void keyPressed(KeyEvent e)      throws NotImplementedException    {      // FIXME: This method calls JComboBox.selectWithKeyChar if the key that       // was pressed is not a navigation key.     }