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

Japanese Input tool does not work properly for JTextField

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 1.2.0, 1.4.0
    • client-libs
    • beta
    • x86, sparc
    • linux, solaris_7

      Disclaimer: Sorry I didnot find proper Category to put this bug in BugSter
                 
                 It is Swing problem with Japanese input tool( on SUSE9.0
                 jdk1.4.2_01 and jdk 1.5.0_01-ea)
       

      IHAC who encounters a problem

      kinput2 doesnot work problem for Swing's JTextField,
      but it works fine for other software 's Text Field(For Example, Mozilla)

      To reproduce the problem
      You have to
      1) in SUSE9.0 installed required Japanese fonts rpms

      2) start you cannaserver (by typing canaserver)

      3) start your japanese input tool kinpu2 against canaserver (by typing kinpu2 -canna)

      in attachments

      1) Bugreport.txt described the detailed problem, required locale setting for OS
         requried japanese fonts rpm, instruction to reproducing testcase.
        
      2) KeyboardTest.java is java testcase code

      3) KeyboardTest.class is compile class file
      ###@###.### 10/26/04 11:32 GMT


      From the attachments:


      Bugreport.txt:

      Summary: Input method gets inactive when switching between entry fields
      ================================================================================================

      Operating systems:
      ==================
      Linux : Linux ls3614 2.4.21-243-default #1 Thu Aug 12 15:22:14 UTC 2004 i686 i686 i386 GNU/Linux
      Distribution: SuSE 9.0 but observable with all other tested distributions

      Java version:
      =============
      java version "1.4.2_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
      Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)

      java version "1.5.0_01-ea"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-ea-b01)
      Java HotSpot(TM) Client VM (build 1.5.0_01-ea-b01, mixed mode)

      and anything below and in between

      System setup:
      =============
      J2RE 1.4.2

      Locale :
      LANG=ja_JP.eucJP
      LC_CTYPE=ja_JP.eucjp
      LC_NUMERIC=de_DE@euro
      LC_TIME=de_DE@euro
      LC_COLLATE=de_DE@eurov
      LC_MONETARY=de_DE@euro
      LC_MESSAGES=en_US
      LC_PAPER="ja_JP.eucJP"
      LC_NAME="ja_JP.eucJP"
      LC_ADDRESS="ja_JP.eucJP"
      hLC_TELEPHONE="ja_JP.eucJP"
      LC_MEASUREMENT="ja_JP.eucJP"
      LC_IDENTIFICATION="ja_JP.eucJP"
      LC_ALL=

      XMODIFIERS=@im=kinput2

      kinput2 as input method frontend
      cannaserver as conversion backend

      processes:

      wnn 1198 1 0 Oct19 ? 00:00:00 /usr/sbin/cannaserver -u wnn -r /var/lib/canna
      d024679 11682 11680 0 10:36 pts/9 00:00:00 kinput2 -canna

      Description:
      ============

      After activating the input method on an entry field with Ctrl-SPACE
      and entering and commiting text, a focus change to another entery
      field in the same frame deactivates the input method. Under 1.4.2 the
      input methods state indicator is not correctly updated, under 1.5.0_01
      the indicator goes off. To further type text into the second field the
      input method has to be activated again, preventing fluent data entry.

      Reproduction:
      =============

      JRE 1.4.2

      Install the necessary fonts from xtt-fonts-xxx.rpm setup the required
      japanese locale, cannaserver and kinput2

      start the test program : java IMTest.FontTest

      Click into the first entry field, activate the input method with
      Ctrl-SPACE. Note the IM indicator showing the active script. Enter ka
      and commit the text.

      Press TAB to focus the second entry field. Note IM indicator still
      indicates the IM is active.

      Enter ka and note that input is not sent to the IM frontend.

      Press Ctrl-SPACE and note that the IM indicator does not change.

      Enter ka and note the IM is active again.


      KeyboardTest.java:

      package IMTest;

      import java.awt.GraphicsConfiguration;
      import java.awt.event.KeyEvent;
      import java.io.ByteArrayInputStream;
      import java.io.InputStreamReader;
      import java.util.Locale;

      import javax.swing.JFrame;
      import javax.swing.JMenu;
      import javax.swing.JMenuBar;
      import javax.swing.JMenuItem;
      import javax.swing.JTextField;

      public class KeyboardTest extends JFrame
      {
          private JTextField textField = null;
          private JTextField textField2 = null;
          private JMenuBar menuBar = new JMenuBar();
          private JMenu fileMenu = new JMenu("File");
          private JMenuItem menuItem = new JMenuItem("Exit");
          public KeyboardTest()
          {
              super();
              init();
          }

          public KeyboardTest(GraphicsConfiguration gc)
          {
              super(gc);
              init();
          }

          public KeyboardTest(String title)
          {
              super(title);
              init();
          }

          public KeyboardTest(String title, GraphicsConfiguration gc)
          {
              super(title, gc);
              init();
          }

          public void init()
          {
              fileMenu.add(menuItem);
              menuBar.add(fileMenu);
              this.setJMenuBar(menuBar);
              this.getContentPane().setLayout(null);
              this.setSize(250,200);

              textField = new JTextField();
              textField.setLocation(10,10);
              textField.setSize(200,20);
              
              textField2 = new JTextField();
              textField2.setLocation(10,30);
              textField2.setSize(200,20);
              
              this.getContentPane().add(textField);
              this.getContentPane().add(textField2);

              this.setVisible(true);
              this.printInfoHeader();
          }
          
          
          public void printInfoHeader()
          {
              Locale locale = Locale.getDefault();
              System.out.println("============================================================");
              System.out.println("Operating system: " + System.getProperty("os.name")+ ", " + System.getProperty("os.version"));
              System.out.println("Java VM version : " + System.getProperty("java.vm.version"));
              System.out.println("System locale : " + locale);
              System.out.println("Default encoding: " + (new InputStreamReader(new ByteArrayInputStream(new byte[0])).getEncoding()));

              System.out.println("============================================================");
          }

          public static void main(String[] args)
          {
              //JFrame.setDefaultLookAndFeelDecorated(true);
              JFrame frame = new KeyboardTest("Keyboard Test");
           }
      }
      ###@###.### 10/28/04 17:24 GMT

            xlu Xiaobin Lu (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: