LAF : Java Glossary
home L words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
LAF
Look And Feel. Swing has programmable look and feel. It can be made to look like Motif, Mac etc.
Mac L&F Decorating Learning More
Selecting Programmatically Icons Books
Command Line Overriding Links
Discovering Installed L&Fs Gotchas

Mac L&F

The Mac LAF is disabled except for Mac platforms. This is restriction is fairly easy to defang. Just change this method:
public boolean isSupportedLookAndFeel()
   {
   return isNativeLookAndFeel();
   }
to this one:
public boolean isSupportedLookAndFeel()
   {
   return true;
   }

Selecting L&F Programmatically

Selecting L&F On the Command Line

You can also set the default look and feel on the command line:

Discovering Installed L&Fs

Decorating

You can further improve the look with: JFrame.setDefaultLookAndFeelDecorated( true );

L&F Icons

You can use the get at the current L&F icons with code like this:
// Get an icon that looks just like the one the L&F uses
// for closing internal frames.
Icon closeIcon = UIManager.getIcon( "InternalFrame.closeIcon" );

Overriding

You can override colours in a given L&F with code like this:
// overriding a colour in the L&F
UIManager.put( "TabbedPane.selected", Color.RED );
The values you can feed to UIManager.put are undocumented, but you can learn about them by studying the source code in src.zip for javax.swing.basic.BasicLookAndFeel. java.

Sun’s Javadoc on the LookAndFeel class : available:
Sun’s Javadoc on the UIDefaults class : available:

Another approach is to write your own Look & Feel that extends some other one, and just overrides a few font-defining methods or colour-defining methods. See this sample code for a writing a derived LAF.

Gotchas

If you change the L&F dynamically, sometimes parts of your app won’t change. You can find all frames and get them to refresh with code like this:

If you load your look and feel with a custom class loader, you must use this undocumented hook so that Swing will use your loader to look for LAF classes:

// persuade Swing to use your custom class loader to load LAF classes
UIManager.getDefaults().put( "ClassLoader", loader );

Nimbus LAF will be coming soon as part of the JDK, but it won’t be the default. It will have hardware acceleration support.

Learning More

Sun’s Javadoc on the UImanager class : available:

Books

book_cover recommend book⇒Java Look and Feel Design Guidelines (2nd Edition)
 paperback
ISBN13:978-0-201-72588-9
ISBN10:0-201-72588-6clickcounter
publisher:Addison-Wesley
published:2001-03-19
by:Sun Microsystems
This book contains no code. It about how to design a good UI using Metal as an example. It contains Sun’s standards for how many pixels to use for various purposes.
Canadian flag amazon.ca. amazon.com. American flag
Canadian flag chapters.indigo.ca . powells.com American flag
French flag amazon.fr. barnesandnoble.com American flag
German flag amazon.de. amazon.co.uk. UK flag

book_cover recommend book⇒Java Look and Feel Design Guidelines: Advanced Topics
 paperback
ISBN13:978-0-201-77582-2
ISBN10:0-201-77582-4clickcounter
publisher:Addison-Wesley
published:2001-12-27
by:Sun Microsystems
It is about how to design a good UI using Metal as an example.
Canadian flag amazon.ca. amazon.com. American flag
Canadian flag chapters.indigo.ca . powells.com American flag
French flag amazon.fr. barnesandnoble.com American flag
German flag amazon.de. amazon.co.uk. UK flag

book_cover recommend book⇒GUI Bloopers: Don’ts and Do’s for Software Developers and Web Designers
 paperback
ISBN13:978-1-55860-582-4
ISBN10:1-55860-582-7clickcounter
publisher:Morgan Kaufmann
published:2000-03-17
by:Jeff Johnson
Works by analysing 82 examples of bad design.
Canadian flag amazon.ca. amazon.com. American flag
Canadian flag chapters.indigo.ca . powells.com American flag
French flag amazon.fr. barnesandnoble.com American flag
German flag amazon.de. amazon.co.uk. UK flag
Alloy Look & Feel
changing default fonts
decorated
GUI
JavooToo Look & Feel Collection
JGoodies Looks Plastic LAF
JGoodies Looks Windows LAF
Microsoft Vista User Experience (LAF) guide
Napkin LAF: for presenting prototype ideas
Nimbus: very clean cross-plattform LAF
skin
SkinLF: over 20 L&Fs
Substance: with component-level scaling
Swing
TrendySoft LAF: exceptionally simple and clean

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.18] The information on this page is for non-military use only.
You are visitor number 16,590. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/laf.html J:\mindprod\jgloss\laf.html