changeset 52894:e6753ace7f6d

8187364: Unable to enter zero width non-joiner (ZWNJ) symbol in Swing text component Reviewed-by: serb, dmarkov
author alitvinov
date Mon, 12 Nov 2018 22:28:08 +0000
parents 1a62b3420c27
children 4c436aab570a
files src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java	Mon Nov 12 12:39:03 2018 +0530
+++ b/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java	Mon Nov 12 22:28:08 2018 +0000
@@ -878,11 +878,10 @@
                         isPrintableMask = ((SunToolkit)tk).isPrintableCharacterModifiersMask(mod);
                     }
 
-                    if (isPrintableMask) {
-                        char c = content.charAt(0);
-                        if ((c >= 0x20) && (c != 0x7F)) {
-                            target.replaceSelection(content);
-                        }
+                    char c = content.charAt(0);
+                    if ((isPrintableMask && (c >= 0x20) && (c != 0x7F)) ||
+                        (!isPrintableMask && (c >= 0x200C) && (c <= 0x200D))) {
+                        target.replaceSelection(content);
                     }
                 }
             }