Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8158566

Provide a Swing property to not close toggle menu items on mouse click

    Details

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alexsch Alexandr Scherbatiy
                Reporter:
                prr Philip Race
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: