### JToolBar

##### Client properties:

Property | Type | Notes
--- | --- | ---
`Quaqua.ToolBar .style` | `java.lang.String` | Values: `"plain", "title", "bottom", "gradient"` The `"title"` style requires that the client property `apple.awt.brushMetalLook` is set on the JRootPane.
`Quaqua.ToolBar .isDividerDrawn` | `java.lang.Boolean` | If set to `Boolean.FALSE`, turns the divider line between the toolbar and the center area of its panel off.

#### General

The style of a toolbar provides a visual cue about its purpose.

- "plain" style: This style was in use from Mac OS X 10.0 through 10.4. Use this style only, if none of the other styles fit your purpose.
- "title" style: Use this style for the toolbar at the top of a window.
  Tool bars with this style should give users immediate access to the most frequently used features in an application.*
- "bottom" style. Use this style for the toolbar at the bottom of a window. Tool bars with this style should give users access to controls that directly affect the contents or organization of the window body.*
- "gradient" style. Use this style for the toolbar at the bottom of a JList, JTree or a JTable.
  Tool bars with this style should affect the contents of a list, tree or table.
  The "gradient" style works best for JTree's which have the client property "Quaqua.Tree.style" set to "sourceList".

* On Mac OS X 10.5 or newer, JToolBar's with the "title"-style fuse with the frame borders of the window, if the client property "apple.awt.brushMetalLook" is set on the JRootPane. JToolBar's with the "bottom"-style always fuse with the frame borders of the window.
Note that the window can be moved by dragging a fused toolbar.

#### Components on a JToolBar

Components added to a JToolBar inherit the style of the JToolBar. This may not always work, if components are first added to a JPanel, and then the JPanel is added to the JToolBar. In this case, it is necessary to set client properties on the components.

JToggleButton's on JToolBar's support the style `toolBarTab`. This style is useful, when an application provides multiple views.

#### Example 1

A floatable `JToolBar` on the left, containing three `JButton`s, a `JSeparator` and three `JToggleButton`s. All buttons have an icon, but no text. The `JSeparator` was created using method `addSeparator` of the `JToolBar`.

Design Notice: Mac OS X applications usually do not use floatable tool bars, but use floating palette windows instead.

JToolBar toolBar = new JToolBar(); toolBar.setFloatable(true); ... toolBar.addSeparator(); JToggleButton videoButton = new JToggleButton(); videoButton.setIcon(anIcon); videoButton.setText(null); toolBar.add(videoButton);

#### Example 2

A non-floatable `JToolBar` placed on the top, containing three `JButton`s, a `JSeparator` and three `JToggleButton`s. All buttons have text only.

JToolBar toolBar = new JToolBar(); ... toolBar.addSeparator(); JToggleButton videoButton = new JToggleButton(); videoButton.setIcon(null); videoButton.setText("Video"); toolBar.add(videoButton);

#### Example 3

A non-floatable `JToolBar` placed on the top, containing three `JButton`s, a `JSeparator` and three `JToggleButton`s. All buttons have an icon and text placed below the icon. The `JToggleButton`s use the client property `Quaqua.Button.style` set to `toolBarTab`.

JToolBar toolBar = new JToolBar(); toolBar.setFloatable(false); ... toolBar.addSeparator(); JToggleButton videoButton = new JToggleButton(); videoButton.setIcon(anIcon); videoButton.setText("Video"); videoButton.setVerticalTextPosition(SwingConstants.BOTTOM); videoButton.setHorizontalTextPosition(SwingConstants.CENTER); videoButton.putClientProperty( "Quaqua.Button.style", "toolBarTab" ); toolBar.add(videoButton);

#### Example 4

A non-floatable `JToolBar` placed on the top, containing three `JButton`s, a `JSeparator` and three `JToggleButton`s. All buttons have text only, the font is set to Lucida Grande 11 (the AHIG "Small system font"). The `JToggleButton`s use the client property `Quaqua.Button.style` to create a "segmented control" look``.

JToolBar toolBar = new JToolBar(); toolBar.setFloatable(false); ... toolBar.addSeparator(); Font smallSystemFont = new Font("Lucide Grande", Font.PLAIN, 11); JToggleButton videoButton = new JToggleButton(); videoButton.setText("Video"); videoButton.setFont(smallSystemFont); videoButton.putClientProperty( "Quaqua.Button.style", "toggleWest" ); toolBar.add(videoButton); JToggleButton structButton = new JToggleButton(); structButton.setText("Struct"); structButton.setFont(smallSystemFont); structButton.putClientProperty( "Quaqua.Button.style", "toggleCenter" ); toolBar.add(structButton); JToggleButton binaryButton = new JToggleButton(); binaryButton.setText("Binary"); binaryButton.setFont(smallSystemFont); binaryButton.putClientProperty( "Quaqua.Button.style", "toggleEast" ); toolBar.add(binaryButton);

####