diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java index 3818fdf..87c2651 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java @@ -234,21 +234,22 @@ public abstract class ParamField extends JPanel { Runnable updateComboBox = new Runnable() { @Override public void run() { - comboBox.removeAllItems(); - for (String s : getItems(lastContent)) { - comboBox.addItem(s); + System.out.println("run updateComboBox"); + String content = field.getText(); + if (content.length() >= 2 && !content.equals(lastContent)) { + lastContent = content; + comboBox.removeAllItems(); + for (String s : getItems(content)) { + comboBox.addItem(s); + } + comboBox.getEditor().setItem(content); + requestView.updateParam(paramName, content); } - comboBox.getEditor().setItem(lastContent); } }; public void update(JTextField field) { - String content = field.getText(); - if (content.length() >= 2 && !content.equals(lastContent)) { - lastContent = content; - SwingUtilities.invokeLater(updateComboBox); - requestView.updateParam(paramName, content); - } + SwingUtilities.invokeLater(updateComboBox); } } -- libgit2 0.21.2