JDK-8013549 : JTextField does not generate KeyReleased event
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: os_x
  • Submitted: 2013-04-04
  • Updated: 2014-11-17
  • Resolved: 2013-04-30
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Java Plug-in 10.9.2.05
Using JRE version 1.7.0_09-b05 Java HotSpot(TM) 64-Bit Server VM

ADDITIONAL OS VERSION INFORMATION :
Darwin audfoy.local.xx.xx 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

A DESCRIPTION OF THE PROBLEM :
In a JApplet the JTextField does not generate the keyReleased event.

I have reproduced this bug both Opera and Firefox.
In Safari everyhing seems to be ok.

REGRESSION.  Last worked in version 6u31

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the applet in either Firefox or Opera
2. Press a key in the JTextField

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
keyTyped
keyPressed
keyReleased missing!
ACTUAL -
keyTyped
keyPressed

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JApplet;
import javax.swing.JTextField;

public class keyReleasedDemoApplet extends JApplet {

public void init() {
JTextField textfield = new JTextField();
getContentPane().add(textfield);
textfield.addKeyListener(new KeyListener() {

@Override
public void keyTyped(KeyEvent arg0) {
System.out.println( " keyTyped " );
}

@Override
public void keyPressed(KeyEvent arg0) {
System.out.println( " keyPressed " );
}

@Override
public void keyReleased(KeyEvent arg0) {
System.out.println( " keyReleased missing! " );
}
});

}
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
If you press multiple keys you MAY get the keyReleased event.
Comments
The issue has been fixed in JDK-8010009 [macosx] Unable type into online word games on MacOSX
30-04-2013