My Oracle Support Banner

Java Swing Application Displays Space Characters in Wrong Position when Entering Korean Text on Ubuntu 16 (Doc ID 2405273.1)

Last updated on FEBRUARY 19, 2019

Applies to:

Java SE JDK and JRE - Version 8 and later
Linux x86


A Java Swing application using the Korean Hangul input method on Ubuntu 16 does not enter space characters in expected places.

Two examples:

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:

  1. Add Korean language in Settings->Language Support,
  2. Add Korean(Hangul)(IBus) in Settings->Text Entry 
  3. Restart system
  4. Compile the program (below)  with command, 'javac'
  5. Run the JTextFieldTest program with command, 'java JTextFieldTest'
  6. 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))
  7. Notice actual contents of text field: '하 나' (the space character is between blocks, not after them)
  8. Perform the above steps on Ubuntu 14
  9. Notice the contents of text field: '하나 ' (with the space character after blocks, as expected)

The following test program,, 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!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.