Smooth Look And Feel

Author

Marcel Offermans - original idea and code.
James Shiell - bug fixes and 0.3 onwards. B. K. Oxley (binkley) - bug fixes and 1.1 onwards.

Description

The SmoothMetal Look and Feel started out as a pure replacement for the Java Metal Look and Feel, with the expressed aim of designing a replacement for this lacklusture effort by Sun. With Sun's expressed aim of redesigning Metal for the Tiger release of Java (1.5) recent work has been targetted at bugfixes and enabling anti-aliasing for the other Java Look and Feels.

Usage

smooth.SmoothLookAndFeelFactory.getSystemLookAndFeelClassName(); returns the appropriate look and feel classname for the current OS, or the standard system look and feel classname if the system look and feel is not Metal or Windows.

UIManager.setLookAndFeel("smooth.metal.SmoothLookAndFeel"); sets the look and feel to Smooth Metal.

UIManager.setLookAndFeel("smooth.windows.SmoothLookAndFeel"); sets the look and feel to Smooth Windows.

To use it with an existing, unmodified application, try java -Dswing.defaultlaf=smooth.windows.SmoothLookAndFeel <appname> (change the LnF classname as appropriate). Note that some applications may force a certain look and feel and thus essentially ignore this define.

If you use the TitledBorder class, you'll need to replace it with SmoothTitledBorder. Apart from this AA will be enabled automatically.

smooth.util.SmoothUtilities contains methods to allow toggling of anti-aliasing and fractional font metrics. Note that you'll need to force a repaint after calling these methods.

java -jar smoothmetal.jar or java -cp smoothmetal.jar smooth.demo.Main runs the demo frame, showing a number of components in the Smooth look and feels. Under Windows, just double click smoothmetal.jar.

Future Features

These are just suggestions - I will be making no further releases.

History
ReleaseDatesNotes
1.1 07/02/2006 21/04/2005
  • Compilable with JDK 1.4.2.
  • Tested with JDK6 beta.
  • Smooth borders of internal frames, internal dialogs and color palettes for SmoothMetal.
  • Update demo app to demonstrate the new smoothings.
  • Show demo app with a JDK default border rather than the native platform border to demonstrate smooth frames better.
  • In demo app toggling anti-alias and font metrics rebuilds the UI from the top-level pane down, not just refreshing it. Smoothed fonts often have somewhat different metrics than unsmoothed, and the layout is imperfect otherwise.
  • Bugfix for JSpinner & FormattedTextFields (990889).
  • Bugfix for Windows LnF name (1186537).
0.4 30/03/2004
  • New demo app, based on the layout of the Alloy LnF app.
  • SmoothTitledBorder added.
  • Bugfix for Windows LnF icons (905623).
  • Bugfix for Windows LnF under Java 1.5.0 Beta 1.
  • Now requires J2SDK 1.5.0B1 to build (runs fine under 1.4.2_03).
0.3 12/07/2003
  • Bugfix for JOptionPane icons.
  • Adds support for Windows Classic/XP Look and Feels.
0.2 31/07/2001
  • Added two classes to correctly render checkbox and radio button menus.
0.1 30/07/2001
  • Initial release.
License (MIT License)

Copyright © 2001 Marcel Offermans.

Includes parts Copyright © 2003-2005 James Shiell.

Includes parts Copyright © 2006 B. K. Oxley.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.