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

Text is unexpectedly removed from JComboBox when composing Japanese

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 1.4.2
    • client-libs
    • tiger
    • x86
    • windows_xp



      Name: ks84122 Date: 04/30/2003


      this is reproducible with the latest mantis build 21:

      Run the following codelet.
      Make sure IME is off at first. Enter some English text in the first combo box, say "test". Then turn on IME and type "ji", note that a Japanese KANA character is composed. Now click on the second combo box.

      //Expected: The first combo box has the text "test" and the composing Japanese KANA character.
      //Actually: The English text "test" is gone, only the Japanese KANA is left on the first combo box.

      Note if there is not setLookAndFeel() call, the behavior is right and as expected.



      public class TestCombo extends JFrame{
        JComboBox jComboBox1 = new JComboBox();
        JComboBox jComboBox2 = new JComboBox();
        public TestCombo() {
          try {
            jbInit();
          }
          catch(Exception e) {
            e.printStackTrace();
          }
        }
        public static void main(String[] args) {
          try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          }
          catch(Exception e) {
            e.printStackTrace();
          }
          TestCombo testCombo1 = new TestCombo();
           testCombo1.pack();
          Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          Dimension frameSize = testCombo1.getSize();


          if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
          }
          if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
          }
          testCombo1.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
          testCombo1.setVisible(true);
        }
        private void jbInit() throws Exception {

          jComboBox1.setEditable(true);
          jComboBox2.setEditable(true);
          this.setSize(new Dimension(400, 300));
          this.getContentPane().add(jComboBox1, BorderLayout.NORTH);
          this.getContentPane().add(jComboBox2, BorderLayout.SOUTH);
        }

      }
      (Review ID: 184554)
      ======================================================================

            naoto Naoto Sato
            ksoshals Kirill Soshalskiy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: