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

[macos] Native IM prediction window appears even if enableInputMethods(false) was called

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, 11, 14
    • client-libs
    • Mac OS X

      FULL PRODUCT VERSION :
      openjdk version "14-ea" 2020-03-17
      OpenJDK Runtime Environment (build 14-ea+17-721)
      OpenJDK 64-Bit Server VM (build 14-ea+17-721, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Mac OS X (Japanese IM activated)

      A DESCRIPTION OF THE PROBLEM :
      Even if Component.enableInputMethods(false) was called,
      Japanese Input Method's prediction window appears.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile and launch the sample code
      2. Turn on Native Japanese IM
      3. Type some key like ,"kyo".

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected:
      "kyo" input to JTextField. No other action.
      Actual:
      "kyo" input to JTextField, and Native IM's prediction window appears.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.event.KeyEvent;
      import java.awt.event.KeyListener;
      import javax.swing.JFrame;
      import javax.swing.JTextField;

      public class DisableIMTest {

      public static void main(String[] args) {
          JFrame frame = new JFrame("DisableIMTest");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JTextField textField = new JTextField();
          textField.enableInputMethods(false);
          textField.addKeyListener(new KeyListener() {
              public void keyPressed(KeyEvent kev) {
                  System.out.println("keyPressed: " + kev);
              }

              public void keyReleased(KeyEvent kev) {
                  System.out.println("keyReleased: " + kev);
              }

              public void keyTyped(KeyEvent kev) {
                  System.out.println("keyTyped: " + kev);
              }
          });
          frame.add(textField);
          frame.pack();
          frame.setSize(300,100);
          frame.setVisible(true);
      }
      }
      ---------- END SOURCE ---------- 

            Unassigned Unassigned
            tnakamura Toshio Nakamura
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: