Could not catch input event via Input Method.

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P3
    • None
    • Affects Version/s: 1.1.2
    • Component/s: client-libs
    • generic
    • generic

      TextField can catch keyinput event if it's made via Input Method.

      The following code is to reject an input of "z", if z is inputed from IME/IM
      it won;t be consumed.


      import java.awt.*;
      import java.awt.event.*;

      public class EchoChar {
        public static void main(String args[]) {
          new EchoChar().run();
        }

        Frame fp;
        TextField tf;

        void run() {
          fp = new Frame("Test");
          fp.add(tf = new TextField(50));
          tf.addKeyListener(
            new KeyAdapter() {
              public void keyPressed(KeyEvent e) {
                if(e.getKeyChar() == 'Z')
                  e.consume();
              }
            }
          );
          fp.pack();
          fp.show();
        }
      }

            Assignee:
            Jeffrey Dunn (Inactive)
            Reporter:
            Norbert Lindenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: