Full Window Content
VAqua supports windows whose content occupies the full window, even the area occupied by the title bar. The title bar is painted over the content, which will show through if the title bar is translucent or has a transparent background. This feature allows the application to paint the full window background or to create a window with rounded corners and no title bar.
A full content window is selected by setting
the Aqua.windowStyle
client property on the root pane to one of these values:
overlayTitleBar
- This style uses a normal title bar, which is painted over the window content. A default border is defined for the content pane with a top inset that matches the title bar height. Using this border ensures that controls will not overlap the title bar. Note that a normal title bar is translucent when the window is active. Optionally, a top and/or bottom window margin may be defined.transparentTitleBar
- This style uses a title bar with a transparent background, which is painted over the window content. A default border is defined for the content pane with a top inset that matches the title bar height. Using this border ensures that controls will not overlap the title bar. However, if the window title is empty, an application may install its own border and place controls that overlap the title bar area. Optionally, a top and/or bottom window margin may be defined. If a top window margin is defined, the default border is not installed. (Placing components in the title bar area is restricted in macOS 10.10 (Yosemite), see below.)noTitleBar
- This style displays a window with no title bar. The window retains its normal shape, with rounded corners. A default border with zero insets is defined for the content pane. Optionally, a top and/or bottom window margin may be defined. (Placing components in the title bar area is restricted in macOS 10.10 (Yosemite), see below.)
When the title bar is transparent or hidden, the platform implementation of moving the window by dragging the title bar may be disabled. If window dragging is desired, the application should install an appropriate mouse listener to implement it. Alternatively, a top window margin may be defined.
Implementation Restrictions
The window style with no title bar does not remove the title bar. Instead, it gives the title bar a transparent background and attempts to prevent the title bar from painting anything. The window title is cleared to avoid painting a title.
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, only components that do not use drag gestures should be placed where they overlap the title bar area. Ordinary buttons are fine. Combo boxes and text fields are not.