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

The em of Ja Hiragana can't be selected from the choicebox by the keyboard input

    XMLWordPrintable

Details

    Description

       (1) Working environments
       OS : Solaris2.6, Windows NT4.0/95
       JDK : JDK1.1.8, JDK1.2 fcs
       Window : CDE
       Japanese Input : Atok7, Atok8
       
       (2) Symtom
       Step1: Read a html file ComboSelect.html including the applet.
               (You can also access http://speed.japan/~kyo/ComboSelect.html
                to see the symtom. The Java plugin1.2 is needed.)
       Step2: Focus the ChoiceBox.
       Step3: You can select both alphabet and Japanese Hiragana items
               in the box by mouse or by arrow-keys.
               However, you may find the em of Japanese Hiragana can't be
               selected by the keyboard input directly, although the alphabet
               items can be.
               
      Notice: If you run the testcase as an application type
              on IBM VisualAge for Java 2.0,
              there is no problem to select the em of Japanese Hiragana
              by the keyboard input directly.

      We find the slection by key-board is related to
      the JComboBox.DefaultKeySelectionManager.
      JComboBox's selection is conducted by selectionForKey method of
      JComboBox.DefaultKeySelectionManager interface, however this method
      isn't called when we input an em letter on the keyboard. So we ask
      whether the input of an em letter of Japanese Hiragana on the keyboard
      is refused on the jvm level, or even KeySelectionManager is not called
      when an em letter is inputed by key-board.


      ---------------<ComboSelect.java>----------------
      //import com.sun.java.swing.*;
      import javax.swing.*;

      public class ComboSelect extends JApplet {
      private JPanel ivjJAppletContentPane = null;
      private JComboBox ivjJComboBox1 = null;
      private JButton ivjOK = null;

      public ComboSelect() {
      super();
      }
      /**
       * @return java.lang.String
       */
      public String getAppletInfo() {
      return "ComboSelect is created by using the VisualAge for Java ";
      }
      /**
       * @return com.sun.java.swing.JPanel
       */
      private JPanel getJAppletContentPane() {
      if (ivjJAppletContentPane == null) {
      try {
      ivjJAppletContentPane = new javax.swing.JPanel();
      ivjJAppletContentPane.setName("JAppletContentPane");
      ivjJAppletContentPane.setLayout(null);
      getJAppletContentPane().add(getJComboBox1(), getJComboBox1().getName());
      getJAppletContentPane().add(getOK(), getOK().getName());
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      };
      return ivjJAppletContentPane;
      }
      /**
       * @return com.sun.java.swing.JComboBox
       */
      private JComboBox getJComboBox1() {
      if (ivjJComboBox1 == null) {
      try {
      ivjJComboBox1 = new javax.swing.JComboBox();
      ivjJComboBox1.setName("JComboBox1");
      ivjJComboBox1.setBounds(92, 48, 130, 27);
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      };
      return ivjJComboBox1;
      }
      /**
       * @return com.sun.java.swing.JButton
       */
      private JButton getOK() {
      if (ivjOK == null) {
      try {
      ivjOK = new javax.swing.JButton();
      ivjOK.setName("OK");
      ivjOK.setText("OK");
      ivjOK.setBounds(135, 177, 91, 23);
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      };
      return ivjOK;
      }
      /**
       * @param exception java.lang.Throwable
       */
      private void handleException(Throwable exception) {

      exception.printStackTrace(System.out);
      }
      public void init() {
      try {
      setName("ComboSelect");
      setSize(426, 240);
      setContentPane(getJAppletContentPane());

      ivjJComboBox1.addItem("\u3042");
      ivjJComboBox1.addItem("\u3044");
      ivjJComboBox1.addItem("\u3046");
      ivjJComboBox1.addItem("\u3048");
      ivjJComboBox1.addItem("\u304a");
      ivjJComboBox1.addItem("a");
      ivjJComboBox1.addItem("b");
      ivjJComboBox1.addItem("c");
      javax.swing.SwingUtilities.updateComponentTreeUI(this);
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      }
      /**
       * @param args java.lang.String[]
       */
      public static void main(java.lang.String[] args) {
      try {
      java.awt.Frame frame;
      try {
      Class aFrameClass = Class.forName("com.ibm.uvm.abt.edit.TestFrame");
      frame = (java.awt.Frame)aFrameClass.newInstance();
      } catch (java.lang.Throwable ivjExc) {
      frame = new java.awt.Frame();
      }
      ComboSelect aComboSelect;
      Class iiCls = Class.forName("ComboSelect");
      ClassLoader iiClsLoader = iiCls.getClassLoader();
      aComboSelect = (ComboSelect)java.beans.Beans.instantiate(iiClsLoader,"ComboSelect");
      frame.add("Center", aComboSelect);
      frame.setSize(aComboSelect.getSize());
      frame.setVisible(true);
      } catch (Throwable exception) {
      exception.printStackTrace(System.out);
      }
      }
      }

      --------------<ComboSelect.java end>----------------

      --------------<ComboSelect.html>----------------

      <HTML>
      <HEAD>
      <TITLE>ComboSelect Applet</TITLE>
      </HEAD>
      <BODY>
      IBM Applet
      <HR>
      <!--"CONVERTED_APPLET"-->
      <!-- CONVERTER VERSION 1.0 -->
      <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
      WIDTH = 2505 HEIGHT = 300 codebase="http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0">
      <PARAM NAME = CODE VALUE = "ComboSelect.class" >

      <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2">
      <COMMENT>
      <EMBED type="application/x-java-applet;version=1.2" java_CODE = "ComboSelect.class" WIDTH = 2505 HEIGHT = 300 pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"><NOEMBED></COMMENT>

      </NOEMBED></EMBED>
      </OBJECT>

      <!--
      <APPLET CODE = "ComboSelect.class" WIDTH = 2505 HEIGHT = 300 >


      </APPLET>
      -->
      <!--"END_CONVERTED_APPLET"-->

      </BODY>
      </HTML>

      --------------<ComboSelect.html end>----------------

      Attachments

        Activity

          People

            alexp Alexander Potochkin (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: