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

in KeyEvent there exists no KeyCode for '+' (61=0x3C)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.2.2
    • client-libs
    • x86
    • windows_nt



      Name: rlT66838 Date: 08/12/99


      Pressing the '+'-Button, the Programm fires a KeyEvent with
      KeyCode==61 (=0x3C), but the class KeyEvent does not contain any constant
      VK_xxx=0x3C.
      Furthermore VK_PLUS==0x0209

       If you type '+' into the TextField, you will see that the KeyCode triggered is 61 while
      KeyEvent.VK_PLUS = 521.

      ----------Test Case---------------

      import java.awt.event.*;
      import javax.swing.JFrame; ,
      import javax.swing.JTextField;

      public class KeyBug extends JFrame
      {
      JTextField feld;

      public KeyBug()
      {
      feld = new JTextField();
      feld.addKeyListener(new KeyAdapter()
      {
      public void keyPressed(KeyEvent evt)
      {
      System.out.println("KeyCode=" + evt.getKeyCode());
      System.out.println("KeyChar=" + evt.getKeyChar());
      }
      });
      this.getContentPane().add(java.awt.BorderLayout.NORTH, feld);
      this.pack();
      this.show();
      }

      public static void main(String[] args)
      {
      System.out.println("PLUS - KeyCode: " + KeyEvent.VK_PLUS);
      KeyBug keyBug = new KeyBug();
      }
      }

      (Review ID: 93517)
      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: