This Java Application is being used as a testing grounds for JCheckBox versus JCheckBoxMenuItem issues. When I was testing using these java components, I found that the ENTER key was the default key binding in the Windows Look&Feel, to check and/or uncheck JCheckBoxMenuItems. When using the ENTER key, the JMenu is also dismissed or retracted. I did not like this behavior, especially when a JMenu offered several JCheckBoxMenuItems within a JMenu, because it forces the user to re-open the JMenu several times to check and/or uncheck all the items they may need to select.
I decided what would be nice, is the ability to use the SPACEBAR to check and/or uncheck items while leaving the JMenu open, but this was not the default key binding for JCheckBoxMenuItem components like it is for JCheckBox components. I decided to see if I could write some Java code to emulate this behavior, and this file is the result of that effort.
One problem this raises, if the user is allowed to use the SPACEBAR to check and/or uncheck items, how does the user then dismiss and accept or just dismiss the JMenu. Also, if the user dismisses the JMenu with the ENTER key, the ENTER key by default will either check and/or uncheck whichever JCheckBoxMenuItem is selected.
Another related problem, is what to do if the user makes JMenu selections using the pointing device. The default action is to dismiss the JMenu after a "click" (e.g., to check and/or uncheck on the desired JCheckBoxMenuItem is recorded). Perhaps the pointing device user should also be allowed to make more than one "selection" prior to the JMenu being dismissed.
Therefore, there are several other usability issues to be solved, but the source code is here for anyone interested.
As of April 98, Swing release version 1.0.1, the following seems true: