[MacOS] Java JTextField Character Does Not Display after Input of Single Quote Using 'US International-PC' Keyboard Layout
(Doc ID 2487539.1)
Last updated on JANUARY 03, 2022
Applies to:Java SE JDK and JRE - Version 8 and later
When an 'US International - PC' keyboard layout is used on MacOS, a consonant character entered in a JTextField does not render if it is immediately preceded by a single quote or apostrophe character ('). This problem occurs only with Java applications and not with native applications. For example, entering 'v produces 'v in native applications and only ' in Java applications.
The issue can be reproduced with the following steps:
- On MacOS, attach a US International - PC keyboard
- Install Java
- Compile the following sample program, named JTextFieldTest.java:
This sample code is provided for educational purposes only. It is not supported by Oracle Support. It has been tested internally, however we do not guarantee that it will work for you. Ensure that you run it in a safe test environment. Additionally, the code and object names used in this article represent fictitious sample names that make up an example. Any similarity to actual code is purely coincidental and not intended in any other manner.
5. After text field appears, type single quote (apostrophe) character ('), then type the letter v.
6. Notice the result is only a single quote (apostrophe) character (') is displayed.
The issue affects the following releases:
- Java SE 8 Update 241 and all earlier updates
- Java SE 9 all updates
- Java SE 10 all updates
- JDK 11 Update 11.0.6 and all earlier updates
- JDK 12 all updates
- JDK 13 all updates
- JDK 14 all updates
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document