:: Menu Bar and Tool Bar Options ::
The following JGoodies options enable you
to tweak the visual appearance of your menu- and tool bars.
Setting Header Style
Setting a header style is the recommended way
to tell the JGoodies looks, that a menu bar
or tool bar is in the application header.
Each JGoodies look will look for a header style
and then choose an appropriate look-specific border and 3D effect.
JMenuBar menuBar = new JMenuBar();
menuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH);
JToolBar toolBar = new JToolBar();
toolBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH);
Use the HeaderStyle.BOTH if both, menu bar and tool bar
are in the application's header. The look may then wrap both
components with a border. Use HeaderStyle.SINGLE
in case, you have just a menu bar or tool bar
in the header.
Border Style
You can override the header style by setting a look-specific
BorderStyle: EMPTY, ETCHED,
or SEPARATOR. For example:
JMenuBar menuBar = new JMenuBar();
menuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
menuBar.putClientProperty(PlasticLookAndFeel.BORDER_STYLE_KEY, BorderStyle.SEPARATOR);
Plastic 3D Hint
Plastic chooses an appropriate default pseudo 3D effect
for the specified header and border style.
You can override the default by setting a Plastic 3D hint:
JMenuBar menuBar = new JMenuBar();
menuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
menuBar.putClientProperty(PlasticLookAndFeel.IS_3D_KEY, Boolean.FALSE);
|