:: JGOODIES Looks :: Professional Swing Look&Feels

:: Other Options ::

Narrow Button Margins

Sun's Java l&f and Windows l&f implementations use a button margin of 14 pixels on each side. While this will often lead to good minimum button widths, it can waste screen space if you use long labels, especially in button grids. See the Narrow Test page in this demo.

The JGoodies l&fs allow you to use narrow button margins, which you can switch on for all buttons, or for individual buttons. Using narrow margins globally may significantly change your panel layout, if your layout management doesn't care about minimum button sizes. Hence, it is switched off by default.

The following code demos the global and individual options using the Options class and Strings:

   Options.setUseNarrowButtons(true);
   JButton button = new JButton("Remove All Entries");
   button.putClientProperty(Options.IS_NARROW_KEY, Boolean.TRUE);

   UIManager.put("jgoodies.useNarrowButtons", Boolean.TRUE);
   JButton button = new JButton("Remove All Entries");
   button.putClientProperty("jgoodies.isNarrow", Boolean.TRUE);

Default Icon Size

The JGoodies l&fs try to vertically align menu item labels. Therefore a default icon size is is used if no icon is set. You should set this default size using one of the following methods:
     
   Options.setDefaultIconSize(new Dimension(18, 18));

   UIManager.put(
      com.jgoodies.looks.Options.DEFAULT_ICON_SIZE_KEY, 
      new Dimension(18, 18));

No Icon in Menu

You can set a client property for JMenus to indicate that no item in this menu has an icon. You can see this effect in the File->New submenu and in the backward button popup-menu of this help viewer.
   JMenu menu = new JMenu();
   menu.putClientProperty(Options.NO_ICONS_KEY, Boolean.TRUE);

Popup Menu Drop Shadow

You can enable or disable drop shadows for popup menus. As of the Looks 1.3 this feature is enabled on modern Windows (98/ME/2000/XP) and disabled otherwise.

Note that this feature may be inactive even though it is enabled. For example drop shadows are always inactive on the Mac OS X, because this platform already uses native drop shadows. See also Options#isPopupDropShadowActive().

   Options.setPopupDropShadowEnabled(true);
   
   UIManager.put("jgoodies.popupDropShadowEnabled", Boolean.TRUE);
Also, you can enable or disable this feature in the system properties. This will override the UIManager setting.
java -Djgoodies.popupDropShadowEnabled=true ...

Tabbed Panes without Content Border

You can set a hint to paint tabbed panes without content border:
   JTabbedPane tabbedPane = new JTabbedPane();
   tabbedPane.putClientProperty(Options.NO_CONTENT_BORDER_KEY, Boolean.TRUE);

Tabbed Panes with Embbedded Tabs

You can set a hint to render tabbed pane tab in an embedded style:
   JTabbedPane tabbedPane = new JTabbedPane();
   tabbedPane.putClientProperty(Options.EMBEDDED_TABS_KEY, Boolean.TRUE);

Tab Icons

You can disable tab icons in the JGoodies looks:
   Options.setTabIconsEnabled(false);

No Tree Lines

Since Looks 1.1 you can hide the lines in trees by setting a client property. The property key and values are a subset of the Metal lines style properties.
   JTree tree = new JTree();
   tree.putClientProperty(Options.TREE_LINE_STYLE_KEY, 
                          Options.TREE_LINE_STYLE_NONE_VALUE);
(c) 2004 JGoodies