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

BACKSPACE POSTED TO PEER TEXTFIELD BEFORE KEYPRESSED()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.1.1
    • 1.1
    • client-libs
    • None
    • 1.1.1
    • sparc
    • solaris_2.5
    • Not verified



      Name: mc57594 Date: 02/14/97


      When a keyPressed() event is generated on a text component
      the text
      is the value before the key press for most keys, but if the
      backspace
      key is pressed the value of the component returned by getText()
      already
      reflects the changes made by the backspace key.
      ---------------
      TestCase:
      import
      java.awt.*;
      import
      java.awt.event.*;
      import
      java.applet.*;
      public class Bug1Applet extends Applet implements
      KeyListener
      {
        TextField
      tf;
        public void
      init()
       
      {
          tf = new
      TextField(10);
         
      tf.addKeyListener(this);
         
      add(tf);
       
      }
        public void keyPressed(KeyEvent
      e)
       
      {
          System.out.println("Text at key-pressed = " +
      tf.getText());
       
      }
        public void keyReleased(KeyEvent
      e)
       
      {
          System.out.println("Text at key-released = " +
      tf.getText());
       
      }
        public void keyTyped(KeyEvent
      e)
       
      {
       
      }
      }
      ======================================================================

            amfowler Anne Fowler (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: