- Pluggable look and feel
Pluggable look and feel is a mechanism used in the Java Swing
widget toolkit allowing to change the look and feel of thegraphical user interface at runtime.Swing allows to specialize the look and feel of widgets, by modifying the default (via runtime parameters), deriving from an existing one, by creating one from scratch, or, beginning with J2SE 5.0, by using the
skinnable synth look and feel, which is configured with anXML property file. The look and feel can be changed at runtime.Architecture
The corresponding API includes:
* Hooks in Swing widgets to interact with their look and feel. Each widget defined in Swing can delegate its "painting" to its associated user interface classes called "UI delegates".
* An API to manage existing look and feel definitions. This API allow to set the look and feel or switch from look and feels at runtime.
* Another API to define a specific look and feel, or derive a look and feel from an existing one.Examples of look and feels
Platform look and feels
The
Java platform comes with several bundled look and feels [cite web
url=http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html#available
title=Java Tutorials: Available Look and Feels
publisher=Sun Microsystems
date=2008-02-14
accessdate=2008-05-25] :
* A defaultcross-platform look and feel, called "Metal" (see Javadoc:SE|javax/swing/plaf/metal|MetalLookandFeel). This look and feel comes with several themes:
** The Javadoc:SE|javax/swing/plaf/Metal|DefaultMetalTheme, which was historically the first Swing default theme.
** The smoother Javadoc:SE|javax/swing/plaf/Metal|OceanTheme, which became the default theme for Java 5.0.
* Other cross-platform look and feels:
** Askinnable look and feel called synth (see Javadoc:SE|package=Synth Look and Feel|javax/swing/plaf/synth), which is configured with anXML property file.
** The "Nimbus" look and feel (based on "synth"), which is added for the Java SE 6 Update 10 [cite web
url=http://www.jasperpotts.com/blog/category/nimbus/
title=Nimbus Category
First=Jasper|Last=Potts
date=2007-12-07
accessdate=2008-05-25] [cite web
url=http://java.sun.com/javase/downloads/ea/6u10/nimbus.jsp
title=Nimbus
publisher=Sun Microsystems
accessdate=2008-05-25] .
* Platform dependent look and feels [cite web
url=http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html#available
title=Available Look and Feels
publisher=Sun Microsystems
accessdate=2008-05-25] : Look and feels that aim to be the closest as possible to the platform native GUI. The fidelity to the native look and feel theming has been improved in recent Java versions by leveraging the platform native GUI theming library when possible [cite web
url=http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6185456
title=GTK Native L&F Fidelity
publisher=Sun Microsystems
accessdate=2008-05-25] [cite web
url=http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5106661
title=XP L&F does not work on Windows Vista (Longhorn) - needs to use uxtheme api
publisher=Sun Microsystems
accessdate=2008-05-25]
** A Windows look and feel (this look and feel depends on the version of the Windows Operating System),
** A Motif orGTK+ (for newer distributions) look and feel onLinux or Solaris,
** A specific vendor look and feel for IBM AIX,HP-UX , andMac OS X .Third-party look and feels
Numerous other look and feels have been developed by third parties, such as:
* [https://substance.dev.java.net/ Substance] , a skinnable look and feel,
* [http://napkinlaf.sourceforge.net/ Napkin] , which can be used to make GUI work look provisional,
* [http://www.javasoft.de/jsf/public/products/synthetica Synthetica] , which is based on synth,
* [https://liquidlnf.dev.java.net/ Liquid] , which aim to look like the "Liquid" theme forKDE ,
* [http://www.jgoodies.com/freeware/looks/index.html JGoodies] Windows and plastic look and feels.References
ee also
*
Look and feel
* SwingExternal links
* [http://www.java2s.com/Product/Java/Swing/Look-And-Feel-LaF.htm a list of Java look and feels]
* [http://72.5.124.55/docs/books/tutorial/ui/features/plaf.html Sun's tutorial overview of the pluggable look and feel mechanism]
* [http://java.sun.com/products/jfc/tsc/articles/architecture/index.html#pluggable Swing pluggable look and feel architecture]
* [http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html Sun's tutorial on setting the look and feel in Java]
Wikimedia Foundation. 2010.