Enhancing toggle menu buttons in Flamingo 5.0

May 14th, 2010

Toggle menu buttons were added to the Flamingo component library a few days ago, and their functionality has been enhanced following feedback from Pedro. In addition to tweaking the visual layout of the area between the icon and the text, the two improvements are:

  • Showing a checkmark when the selected toggle menu button does not have an icon
  • Popup menus that are not automatically dismissed when a child menu button is clicked

The second entry enhances the usability of popup menus that have multiple toggle menu buttons. Here is a screenshot to demonstrate such a scenario (note checkmarks on the selected buttons):

https://flamingo.dev.java.net/release-info/5.0/popup-menu-no-auto-dismiss.png

If this menu controls a set of boolean options / preferences, dismissing the menu after a single button has been clicked (selected toggled) is a bad user experience if the user wanted to change multiple settings. To prevent the auto-dismissal, call the new JCommandPopupMenu.setToDismissOnChildClick(false) API. This way the menu will stay up until the user clicks anywhere outside it or hits the Escape key.

If you want to take the new toggle menu buttons for a spin, you will need the following:

Note that the last two are required if you’re running your application under one of Substance skins.