-
Bug
-
Resolution: Fixed
-
P3
-
1.1
-
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)
{
}
}
======================================================================