Mac OS Renderer
The Mac has different conventions from most other platforms for rendering buttons and menus. GUI Commands automatically installs a special renderer on the Mac that ensures:
The following examples show how the exact same face configurations are rendered on Windows and the Mac:
Overriding the Default Behaviour
It is possible to override this default behaviour by configuring the static properties of the
// turn menu icons and mnemonics back on for the Mac MacOSFaceRenderer.setMenuMnemonicsEnabled(true); MacOSFaceRenderer.setMenuIconsEnabled(true); // turn button mnemonics back on for the Mac MacOSFaceRenderer.setButtonMnemonicsEnabled(true);
Please note that there are some issues using Apple's Aqua look and feel under certain button configurations (namely with text positioned under the icon). You may want to consider the excellent Quaqua Look and Feel to overcome these limitations.
Quaqua provides the capability of rendering toolbar buttons in various styles. GUI commands provides a special
property on toggle groups to automatically render toolbar buttons using Quaqua's inbuilt styles. The two available
styles are rounded and tabbed. When using the rounded style, the first and last members of the toggle group are
automatically configured with the
The following example demonstrates configuring a toggle group to generate rounded buttons on toolbars:
email@example.com=Text Styles firstname.lastname@example.orgProperties[Quaqua.Toolbar.style]=rounded group!style-group@toggle=true group!style-group@exclusive=false group!style-group@members=bold, italic, underline
The following image shows examples of both the rounded and tabbed toolbar styles.
Using Client Properties
Both Quaqua and the standard Aqua look and feels allow you to specifiy client properties to control the
appearance of buttons on the Mac. You can specify any number of client properties in your standard
face configuration to control your button appearance as required. The following are examples of configuring
email@example.com=Push Me firstname.lastname@example.orgProperties[JButton.buttonType]=toggle
The list of valid styles is covered in the Java Development Guide for Mac OS X.
While the JButton.buttonType property is useful, a much greater level of control over button styles can be
achieved using GUI Commands with the Quaqua look and feel. The following examples configures the
email@example.com=Quaqua firstname.lastname@example.org=images/smile.gif email@example.comProperties[Quaqua.Button.style]=square