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

character subset is not set as expected in JTextField

XMLWordPrintable

      OS: ALL
      Build:
      this issue reproduced on JDK 9 141, 6u141b06, 7u131b06, 8u121b07

      steps to reproduce:
      #Create a new J text field
      tfKata = new JTextField(20);
      #Set the field only accept a part of unicode characters
      getContentPane().add(setPanel(tfHKata,
                                                "Character.UnicodeBlock.KATAKANA"));
      tfHKata.addFocusListener(new FocusAdapter() {
                      public void focusGained(FocusEvent e) {
                          InputContext ic = tfHKata.getInputContext();
                          Character.Subset[] s = { Character.UnicodeBlock.KATAKANA };
                          ic.setCharacterSubsets(s);
                      }
                  });

      Actual results:
      any kind of characters can be typed in all text fields.

      Expected Results:
      only restricted characters can be typed.

            prr Philip Race
            yliu Johnny Liu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: