From: gmungoc Date: Mon, 29 Oct 2018 15:02:39 +0000 (+0000) Subject: JAL-3038 add ActionListener and FocusListener to SwingJS mode X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~68^2~436^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=b11a3470c5ccd9eeb4e80c1e85b282dcc8111b4a;p=jalview.git JAL-3038 add ActionListener and FocusListener to SwingJS mode --- diff --git a/src/jalview/io/cache/JvCacheableInputBox.java b/src/jalview/io/cache/JvCacheableInputBox.java index d2ad8de..b1b7ac5 100644 --- a/src/jalview/io/cache/JvCacheableInputBox.java +++ b/src/jalview/io/cache/JvCacheableInputBox.java @@ -306,7 +306,11 @@ public class JvCacheableInputBox public void addActionListener(ActionListener actionListener) { - if (!Jalview.isJS()) + if (Jalview.isJS()) + { + textField.addActionListener(actionListener); + } + else { comboBox.addActionListener(actionListener); } @@ -323,7 +327,11 @@ public class JvCacheableInputBox public void addFocusListener(FocusListener focusListener) { - if (!Jalview.isJS()) + if (Jalview.isJS()) + { + textField.addFocusListener(focusListener); + } + else { comboBox.addFocusListener(focusListener); }