Name: gm110360 Date: 03/11/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows 98 [Version 4.10.2222]
A DESCRIPTION OF THE PROBLEM :
With the Java 2 Plug-in, a Java applet does not receive
java.awt.event.KeyEvent.VK_TAB events in the
keyPressed(KeyEvent e) method, despite the fact that the
applet has the keyboard focus. All other keyboard events
appear to be passed in properly -- there may be other
exceptions, but I have not found any.
This behavior is inconsistent with the Netscape Navigator
implementation of applets, and also inconsistent with the
behavior of applets when they are run in Internet Explorer
under Microsoft's VM for Java.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Code a simple applet with a keyPressed(KeyEvent e)
method.
2. In the keyPressed(KeyEvent e) method, log all events
received, by printing them to the Java console with a
statement like:
System.out.println("keyPressed: " + e);
3. Issue calls to requestFocus() as necessary (according to
the design of the applet).
4. Code an HTML Web page that invokes the applet and install
the Web page and applet on a Web server.
5. Access the Web page from a browser, with the Java console
enabled.
6. Ensure the applet has the keyboard focus, by clicking the
mouse on the applet's window "box" on the Web page.
7. Press various keys on the keyboard and observe the
results in the Java console. Observe that the "Tab" key
produces no message in the Java console, but all other keys
are logged.
8. Try the same experiment without the Java 2 Plug-in, using
the Java support shipped with Netscape Navigator or the
Microsoft version of Java for Internet Explorer. Observe
that the "Tab" is logged in the Java console in these cases.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected: Whenever you press the "Tab" key on the keyboard,
the keyPressed(KeyEvent e) method should be called with an
event "e" with e.getKeyCode() set to the value
java.awt.event.KeyEvent.VK_TAB.
Actual: The keyPressed(KeyEvent e) method receives no call
at all when the "Tab" key is pressed.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.applet.Applet;
import java.awt.event.*;
import java.awt.Graphics;
public class keytest extends Applet implements KeyListener
{
public void init()
{
this.addKeyListener(this);
}
public void start()
{
requestFocus();
}
public void stop()
{
}
public void paint(Graphics g)
{
//Draw a Rectangle around the applet's display area.
g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);
}
public void keyPressed(KeyEvent e)
{
System.out.println("keyPressed: " + e);
}
public void keyTyped(KeyEvent e)
{
System.out.println("keyTyped: " + e);
}
public void keyReleased(KeyEvent e)
{
System.out.println("keyReleased: " + e);
}
}
---------- END SOURCE ----------
Release Regression From : 1.3.1_02
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 143957)
======================================================================