Segmented Buttons

MacOS supports a segmented control, which is a single control containing a row of buttons that optionally may be individually selected, either exclusively (like radio buttons) or independently (like checkboxes). Although VAqua does not directly support segmented controls, it allows a segmented control to be simulated using a row of adjacent JButtons and/or JToggleButtons. The details of this simulation are described in Apple Technical Note TN2196.

Segmented buttons support several size options, specified using the JComponent.sizeVariant client property with values regular (the default), small, or mini.

VAqua supports these styles of segmented button:

Segmented

This is the default style for a segmented button. The rendering is context sensitive. A textured style is used if the button is in a JToolBar. A rounded border style is used otherwise. This style is selected by setting the JButton.buttonType client property to segmented.

Textured

A textured button has a flat white background and rounded corners. Textured buttons are recommended for use in the window frame. This style is selected by setting the JButton.buttonType client property to segmentedTextured. This style is used by default if the button is in a JToolBar. A textured toggle button indicates selection using a blue text or (template) icon color (instead of the inverted style) if it is not a member of a ButtonGroup, as do native textured segmented controls that support non-exclusive selection.

Separated

This style is similar to Segmented, except that the buttons are separated by a small gap. The rendering is context sensitive. A textured style is used if the button is in a JToolBar. A rounded border style is used otherwise. This style is selected by setting the JButton.buttonType client property to segmentedSeparated.

Textured Separated

This style is similar to Textured, except that the buttons are separated by a small gap. Textured buttons are recommended for use in the window frame. This style is selected by setting the JButton.buttonType client property to segmentedTexturedSeparated.

Rounded Rectangle

When not selected, a rounded rectangle button is translucent and has a border with rounded corners. This style is selected by setting the JButton.buttonType client property to segmentedRoundRect.

Gradient

This style uses square buttons similar to Gradient buttons. This style is selected by setting the JButton.buttonType client property to segmentedGradient.