JDK-2229826 : [macosx] ActionListener called twice for JMenuItem using ScreenMenuBar
  • Type: Backport
  • Backport of: JDK-7160951
  • Component: client-libs
  • Sub-Component: javax.swing
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-09-12
  • Updated: 2013-09-06
  • Resolved: 2012-09-17
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 7 JDK 8
7u40 b08Fixed 8Fixed
Comments
Verified
06-09-2013

What is Affects Version for this bug. I am not able to reproduce failure. On 7u40b23 - passes On 7u40b07 - passes On 7u25b06 - passes
06-09-2013

Use MenuTest.java from attachment to this bug for verification.
06-09-2013

Test name: Swing_JMenu/Automated/bug7160951
08-08-2013

EVALUATION When user presses a shortcut, we post a Java keyboard event from AWTView's -performKeyEquivalent, which activates menu item in Java layer. Upon returning from -performKeyEquivalent, Cocoa gets a chance to handle this shorcut as well, which results in Cocoa callig CMenuItem's -handleAction. Here, we again post a Java event, hence double activation.
12-09-2012