JDK-6346690 : Mnemonics don't consume proper events
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_redhat_9.0
  • CPU: x86
  • Submitted: 2005-11-07
  • Updated: 2010-09-29
  • Resolved: 2006-02-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b59aFixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
I'll attach a simple application that contains just a text area and menu with two items. If you place focus in the text area and press Alt+F, menu gets posted. If you then try 's' to invoke "test" menu item, it gets invoked, but 's' is written into the text area.
It worked perfectly in b57, gets broken in b58.
It might be related to the change in java/awt/KeyboardFocusManager.java,v1.66 vs 1.65

Comments
SUGGESTED FIX See the webrev here: http://sa.sfbay.sun.com/projects/awt_data/mustang/6346690
28-03-2006

EVALUATION <<I'll also mention that I see this bug on my windows box too. When running NB 5.0 with latest mustang builds if I hit 'Alt-f s' (to save) sometimes the s ends up in the editor. VERY annoying!>> -- by ###@###.###
15-12-2005

EVALUATION It seems that the fix for 5028014 changed the timing and the sequence of events, which resulted in this regression. It is unclear how to restore that sequence without backing-out of the fix. One idea is to consume key-typed events based on whether or not key-pressed events was processed as mnemonic, however neither AWT nor Swing have the necessary instruments so far to do this correctly. We may think about that in Dolphin, though.
07-11-2005

EVALUATION Previously, in b57, we would receive KEY_TYPED when focus owner was either JRootPane or null.
07-11-2005

EVALUATION From the log I see that Swing closes menu on KEY_PRESSED event for 's'. Then focus goes back to text area. Then KEY_TYPED for 's' arrives and AWT dispatches it to the focus owner - text area.
07-11-2005

EVALUATION Could you please provide the source code for the test case?
07-11-2005