Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7200764

Japanese/Microsoft IME is reset to Hiragana each time a dialog box is displayed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 6u31
    • client-libs

      FULL PRODUCT VERSION :
      java version "1.6.0_35"
      Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
      Java HotSpot(TM) Client VM (build 20.10-b01, mixed mode, sharing)
      and
      java version "1.7.0_07"
      Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
      Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 64-bit
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      When using Japanese as the input language with Microsoft IME, after changing the IME input method from the language bar at least once, the IME input method is reset to Hiragana when a dialog box is shown.

      Happens with Java SE 6u35 and Java SE 7u7 in Windows 7. (Works fine in Windows XP).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Make sure Japanese with Microsoft IME is installed in Control Panel > "Region and language", "Keyboards and Languages"
      Start the application and change the input language to Japanese from the language bar and make sure it uses IME.

      What I discovered:
      - If you start the application and don't change the IME input method from the language bar, then it stays as it is (for me it starts in "Half-width Alphanumeric" mode and stays that way) even if you push the button that displays the dialog box.

      - If you change the input method at least once within the application(e.g. Katakana), then when pressing the button and showing the the dialog box, the IME input method is reset to Hiragana.

      - If you change the IME input method repeatedly, it's no longer reset when the dialog box is shown, but when it is closed.

      - Eventually, if you keep setting it to "Half-width Alphanumeric" it will stick (if a dialog is shown twice without changing the input method in-between).

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The IME input method should not be reset when displaying/closing dialogs within the same application. Native applications (Notepad/Wordpad) do not cause this behavior when displaying a dialog (e.g. Find dialog).
      ACTUAL -
      The IME input method is reset to Hiragana if it was just changed (manually) to something else.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.BorderLayout;
      import java.awt.event.ActionEvent;

      import javax.swing.AbstractAction;
      import javax.swing.JButton;
      import javax.swing.JFrame;
      import javax.swing.JOptionPane;
      import javax.swing.JRootPane;
      import javax.swing.JScrollPane;
      import javax.swing.JTextArea;

        public static void main(String[] args) throws Exception {
          final JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          
          JRootPane rootPane = frame.getRootPane();
          frame.getRootPane().setLayout(new BorderLayout());
          rootPane.add(new JScrollPane(new JTextArea()), BorderLayout.CENTER);
          
          JButton button1 = new JButton(new AbstractAction("Button1") {
            @Override
            public void actionPerformed(ActionEvent e) {
              JOptionPane.showMessageDialog(frame, "test");
            }
          });
          rootPane.add(button1, BorderLayout.SOUTH);
          frame.getRootPane().setDefaultButton(button1);
          frame.setSize(400, 200);
          frame.setVisible(true);
        }
      ---------- END SOURCE ----------

            alexsch Alexandr Scherbatiy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: