JDK-8158566 : Provide a Swing property to not close toggle menu items on mouse click
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-02
  • Updated: 2017-07-19
  • Resolved: 2016-06-30
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 9
9 b127Fixed
Related Reports
Relates :  
Relates :  
Description
javax/swing/plaf/basic/BasicMenuItemUI implements as follows :-
protected void doClick(MenuSelectionManager msm) {
...
...

        msm.clearSelectedPath();
 ...
}

The line above closes and unselects all the menu components
once a choice has been made.

External code is over-riding JDK internal classes in order to
prevent this being cleared. In particular it is being applied
by subclassing MotifCheckBoxMenuItemUI and
WindowsCheckBoxMenuItemUI.

Assuming this behaviour is important it would be better done
by setting a swing property.

This would need to be supported by all L&Fs and we can
make it so for at least the built-in ones by modifying the
above code in BasicMenuItemUI
Comments
jdk9-fc-request will be added once we have reviewed code
22-06-2016

Proposed fix: http://cr.openjdk.java.net/~alexsch/8158566/webrev.00/ Review thread: http://mail.openjdk.java.net/pipermail/swing-dev/2016-June/006095.html
14-06-2016

Enhancement is Targeted to 9 as exceptional case
05-06-2016