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: Release_2_11_4_0~45^2~18^2~436^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;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); }