<AWT Dev> Proposal: Windows IME related patch

Ichiroh Takiguchi takiguc at linux.vnet.ibm.com
Thu Jun 14 17:14:40 UTC 2018

IBM would like to contribute Windows IME related Java Input Method 
Framework patch to OpenJDK project.

This patch can fix following issues.
A: Cannot display surrogate pair character on Windows floating IME 
window for passive component
B: Control Windows IME status by using InputSubset and UnicodeBlock for 
CJK countries
C: Check preedit string availability for Windows Chinese IME

To recreate each issue.

Issue A:
1. Run SwingSet2 Java demo program with Japanese IME.
2. Click InternalFrameDemo's "Frame 0".
3. Turn on Japanese IME, then type "2000B" and press F5 key.
The character is not displayed properly. [1]

Issue B:
Test program (ImSubsetsTest.java) is as follow:

1. Compile and run ImSubsetsTest with CJK IMEs
2. Select language (ja:Japanese, ko:Korean, zh: Chinese).
Windows IME (same langugae's one) should be turned on.
3. Click  JTextField (active component) or JButton (passive component)
(Please check IM status is changed or not)
4. Click different color's JTextField (active component) or JButton 
(passive component)
(Please check IM status is changed or not)
5. Following operations did not work

Issue C:
Test program is as follows:
import javax.swing.*;

public class IMFTestA extends JFrame {
   IMFTestA(int width, int height, int x, int y) {
     add(new JTextArea());
     setSize(width, height);
     setLocation(x, y);
   public static void main(String[] args) {
     new IMFTestA(300, 200, 0, 0);
     new IMFTestA(300, 200, 300, 0);

On Chinese IME (Microsoft Pinyin ABC),
1. Compile and run IMFTestA
2. Click one of JTextArea window, turn ON Chinese IME
3. Click the other window, turn ON Chinese IME
4. Type "nihao", then preedit string is displayed
5. Click the other window, turn OFF Chinese IME
6. Click the other window, preedit string is still displayed but it's 
not convertable

Issue A, proper font is not specified for passive component
Issue B, IME mode setting for CJK Windows IME is not correct
Issue C, Chinese Windows IME shares IME status between windows, Java 
needs to check preedit string is available or not

I'd like contribute following 3 files:
M src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java
M src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
M src/java.desktop/windows/native/libawt/windows/awt_InputMethod.cpp

I appreciate any feedback please, and how I would go about obtaining a 
sponsor and contributor?

[1] http://unicode.org/cgi-bin/GetUnihanData.pl?codepoint=2000B

Ichiroh Takiguchi
IBM Japan, Ltd.

More information about the awt-dev mailing list