Extending the Flamingo command buttons

October 21st, 2009

The command button component is a central building block for the Flamingo component suite. It aims to address the deficiencies of the core Swing button components, adding features expected by the modern applications. While the main goal of Flamingo is to provide a pure Java implementation of the Office 2007 ribbon container, the command buttons can certainly be used outside the ribbon.

The latest 4.2dev drop of the core Flamingo library and 6.0dev drop of the Substance Flamingo plugin provide support for command buttons that have no text and/or no icon. This is a big step forward that positions the Flamingo command button as a drop-in replacement for core Swing buttons, and here are a few screenshots to illustrate these new capabilities.

Here is a screenshot of a few command buttons that have both text and icon:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-icon-and-text1.png

Here, the rows show the functionally equivalent command buttons that arrange the text and icon in different layouts – addressing the varying space available to host the specific button. The first column shows action buttons – clicking anywhere on a button will activate the registered listeners. The second column shows split buttons – clicking on icon / text will activate the listeners, while clicking on the drop arrow will show the popup menu.

The next screenshot shows text / icon command buttons of the other two kinds:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-icon-and-text2.png

The first column shows another type of split button – where the popup menu is shown when the text is clicked (as opposed to the first split button type where clicking the text activates the main action). The second column is a menu button – clicking anywhere shows the popup menu.

The next two screenshots show the same button arrangement, but this time for buttons with no icons:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-no-icon1.png

https://flamingo.dev.java.net/release-info/4.2/command-buttons-no-icon2.png

And the final screenshot shows the same button arrangement, but this time for buttons with no texts:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-no-text.png