PLAF-pluggable look&feel in Swing

  • Default Metal style
  • Can emulate Motif, and Windows styles
  • Supports Mac style through download
  • New styles can be designed
  • Can be reset at runtime

Java Look & Feel

Mac OS Look & Feel

 

Motif Look & Feel

Windows Look & Feel

 

The Steps

All components have an abstract UI delegate in the swing.plaf package

(Jbutton - ButtonUI)

UI delegate is accessed by get/setUI() method

 

Each Look and Feel has a concrete class for each abstract UI delegate

(WindowsButtonUI)

communicate through UIManager class get/setLookAndFeel()

a static method

UIManager.setLookAndFeel(x);

x= a String...is the name of the class that implements athe look and feel!!!!!!!!!!!!!!!!

OR

x= an instance of the class LookAndFeel or any child of it like MetalLookAndFeel (in javax.swing.plaf.metal)

EXAMPLE

 

 

 

 

 

© Lynne Grewe 2001