OPERATING SYSTEM(S)
Windows XP (Japanese)
Windows Server 2003 (Japanese)
FULL JDK VERSION(S):
> java -version
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode)
>> java -version
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_03-b07, mixed mode)
DESCRIPTION:
Windows' preedit window should not display on active component.
Because Java handle preedit string by itself.
But when I tried following operation, Windows' preedit window is displayed.
Test instruction is as follows:
1. Run attached test program (JTextInputTest.java)
2. Check Weekday list window has focus, if not, click Weekday list window
3. Turn Japanese IME, type "nichi" (Floating preedit window is displayed)
4. Move window focus to JTextArea window
5. Turn Japanese IME, type "getsu" and press Space key twice.
At this moment, unexpected preedit window is displayed on left-top window.
J2SE 64bit version also has this problem but situation is not same.
==============================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.DateFormatSymbols;
class JTextInputTest extends JFrame {
JTextArea text;
JList list;
JTextInputTest() {
setTitle("JTextArea");
Container c1 = getContentPane();
c1.setLayout(new GridLayout(1,0));
text = new JTextArea("Today is ");
text.setCaretPosition(text.getText().length());
c1.add(text);
JFrame f2 = new JFrame("Weekdays");
Container c2 = f2.getContentPane();
c2.setLayout(new BorderLayout());
DateFormatSymbols d = new DateFormatSymbols();
list = new JList(d.getWeekdays());
c2.add(list, BorderLayout.CENTER);
JButton btn = new JButton("Append");
c2.add(btn, BorderLayout.SOUTH);
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (!list.isSelectionEmpty()) {
text.append(list.getSelectedValue().toString());
}
}
});
f2.pack();
setSize(300,300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
f2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Point pt = getLocationOnScreen();
pt.x += getWidth();
f2.setLocation(pt.x, pt.y);
f2.setVisible(true);
}
public static void main(String[] args) {
JTextInputTest f = new JTextInputTest();
}
}
==============================================================
###@###.### 2005-05-13 15:41:48 GMT