Ejemplo n.º 1
0
  public void keyReleased(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE || e.getKeyCode() == KeyEvent.VK_ENTER) {

      String text = textEditor.getText();
      if (comboBox.isShowing()) {
        suggestionList.hide();
        suggestionList.filter(text);
        suggestionList.show();
      }
    }
  }
Ejemplo n.º 2
0
  public void run() {
    String text = textEditor.getText();

    // need to hide first because Swing incorrectly updates popups (getSize() returns
    // dimension not the same as seen on the screen)
    suggestionList.hide();

    if (comboBox.isShowing()) {
      suggestionList.filter(text);

      if (suggestionList.getItemCount() > 0) {
        suggestionList.show();
      }
    }
  }