Unified Toolbars

VAqua supports three styles of windows with unified toolbars. All three styles use an appropriate window background behind the title bar and the toolbar. The styles differ in the placement of the toolbar relative to the title bar.

A unified toolbar window style is selected by setting the Aqua.windowStyle client property on the root pane to one of these values:

Certain requirements must be met to use a unified toolbar window style. The window must be a decorated window. The content pane must be a Swing component that contains a non-floatable JToolBar or a toolbar panel. The toolbar must be positioned at the top edge of the content pane. These requirements must be satisfied and the style client property must be specified at the time the window is made displayable (made visible or packed). Changes to the client property or replacement of the content pane or toolbar after the window becomes displayable are not supported.

A window using a unified toolbar style may optionally define a bottom window margin.

Implementation Restrictions

VAqua makes some changes to application components to implement a unified toolbar window style. The window title and file icon may be hidden for those styles where the toolbar is combined with or replaces the title bar. (The title bar is still present, but it has a transparent background.) On older systems, the content pane, toolbar, and any intermediate containers are made not opaque, to allow the textured background to be visible. A default border is defined for the toolbar, with insets that position it correctly relative to the title bar. The default border also paints a horizontal line below the toolbar. A mouse listener is installed on the toolbar to implement dragging of the window by the title bar or toolbar backgrounds. An application should not interfere with these changes unless it can emulate their effects.

On macOS 10.10 (Yosemite), the window system continues to implement moving the window when the user drags the title bar area, even though the title bar may have a transparent background or be completely invisible and even though the mouse events are (also) delivered to Java. Therefore, on macOS 10.10, when the toolbar overlaps the title bar area, the toolbar must not contain components that use drag gestures. Ordinary buttons are fine. Combo boxes and text fields are not.