Java Swing Application Displays Space Characters in Wrong Position when Entering Korean Text on Ubuntu 16
(Doc ID 2405273.1)
Last updated on JUNE 25, 2018
Applies to:Java SE JDK and JRE - Version 8 and later
A Java Swing application using the Korean Hangul input method on Ubuntu 16 does not enter space characters in expected places.
1. When entering in a JTextField: '하나' on Ubuntu 16, the actual contents of text field are: '하 나'. Note the space character is placed between blocks, rather than after them as expected.
The issue can be reproduced at will with the following steps on a clean Ubuntu 16.04.1 installation:
- Add Korean language in Settings->Language Support,
- Add Korean(Hangul)(IBus) in Settings->Text Entry
- Restart system
- Compile the JTextFieldTest.java program (below) with command, 'javac JTextFieldTest.java'
- Run the JTextFieldTest program with command, 'java JTextFieldTest'
- Switch to Hangul input method, press Shift+Space to activate Hangul input and enter '하나 ' (to achieve this, press the following keys on standard English keyboard: 'G' 'K' 'S' 'K' ' '(space))
- Notice actual contents of text field: '하 나' (the space character is between blocks, not after them)
- Perform the above steps on Ubuntu 14
- Notice the contents of text field: '하나 ' (with the space character after blocks, as expected)
The following test program, JTextFieldTest.java, can be used to demonstrate the problem in this example:
These symptoms occur only after upgrading from Ubuntu 14 to Ubuntu 16. On Ubuntu 14, the space characters are in the correct places in each of the above scenarios. The issue does not occur with native applications (e.g. gedit) on either Ubuntu 14 or 16.
It is expected that the position of space characters in the Korean language should remain consistent in a Java SE application from one Linux version to the next.
The problem can be seen after upgrading the Ubuntu Linux OS version to Ubuntu 16.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!