JDK-7046873 : Regression : Unexpected IME preedit position on AWT TextArea/TextField
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86
  • Submitted: 2011-05-20
  • Updated: 2011-05-23
  • Resolved: 2011-05-23
Related Reports
Duplicate :  
Description
SYNOPSIS
--------
Regression : Unexpected IME preedit position on AWT TextArea/TextField

OPERATING SYSTEM
----------------
Windows XP Professional x86 SP3 (Japanese)

FULL JDK VERSION
----------------
JDK 7 b134 onwards

PROBLEM DESCRIPTION
-------------------
IME preedit should be displayed on caret position, but it's always displayed on left-top.

This situation seems to be caused by the fix for 6826397 in b134.

STEPS TO REPRODUCE
------------------
1. Compile and run following program
2. Turn on MS-IME
3. Click left side of TextArea
4. Type "aiueo", then Japanes preedit string is displayed into left-top
5. Click another TextArea/TextField
6. Type "aiueo", then Japanes preedit string is displayed into left-top.
   It should displayed on blinking caret position

TESTCASE DESCRIPTION
--------------------
import java.awt.*;
import java.awt.event.*;

class TextAreaTest2 extends Frame {
    TextAreaTest2() {
        setTitle("TextAreaTest2");
        setLayout(new GridLayout(2,2));
        TextArea text = new TextArea();
        text.setFont(new Font("Dialog", Font.PLAIN, 16));
        add(text);
        text = new TextArea();
        text.setFont(new Font("Monospaced", Font.PLAIN, 24));
        add(text);
        TextField textf = new TextField();
        textf.setFont(new Font("Monospaced", Font.PLAIN, 12));
        add(textf);
        textf = new TextField();
        textf.setFont(new Font("Dialog", Font.PLAIN, 36));
        add(textf);
        setSize(500, 300);
        addWindowListener(new WindowAdapter() {
                              public void windowClosing(WindowEvent e) { System.exit(0);}
                          });
        setVisible(true);
    }
    public static void main(String[] args) {
        new TextAreaTest2();
    }
}