Pluggable look and feel

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 the graphical 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 an XML 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 default cross-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:
** A skinnable look and feel called synth (see Javadoc:SE|package=Synth Look and Feel|javax/swing/plaf/synth), which is configured with an XML 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 or GTK+ (for newer distributions) look and feel on Linux or Solaris,
** A specific vendor look and feel for IBM AIX, HP-UX, and Mac 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 for KDE,
* [http://www.jgoodies.com/freeware/looks/index.html JGoodies] Windows and plastic look and feels.

References

ee also

* Look and feel
* Swing

External 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.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Look and feel — is a term used in descriptions of products and fields such as marketing, branding and trademarking, to signify the experience a person has using a product, and the main features of its appearance and interfaces.In software design, look and feel… …   Wikipedia

  • Synth Look and Feel — synth is a skinnable Java look and feel, which is configured with an XML property file.According to Sun, goals for synth were: * Enable to create custom look without writing any code. * Allow appearance to be configured from images. * Provide the …   Wikipedia

  • Comparison of Java and Android API — This article compare the Java and Android API and virtual machine machines. While most Android applications are written in Java, there are many differences between the java API and the Android API, and Android does not use a Java Virtual Machine… …   Wikipedia

  • Swing (Java) — Die Widgets von Swing mit dem Ocean Look and Feel (Standard seit Java 1.5) …   Deutsch Wikipedia

  • Swing (Java) — Swing is a widget toolkit for Java. It is part of Sun Microsystems Java Foundation Classes (JFC) mdash; an API for providing a graphical user interface (GUI) for Java programs.Swing was developed to provide a more sophisticated set of GUI… …   Wikipedia

  • Java Foundation Classes — Die Java Foundation Classes (JFC) ist eine Sammlung von Programmierschnittstellen (APIs) für die Erstellung portabler Java Graphical User Interfaces (GUIs). Die Java Foundation Classes werden durch die folgenden Features definiert: Swing GUI… …   Deutsch Wikipedia

  • Widget toolkit — A widget toolkit, widget library, or GUI toolkit is a set of widgets for use in designing applications with graphical user interfaces (GUIs). The toolkit itself is a piece of software that is generally provided with an operating system, windowing …   Wikipedia

  • Java (programming language) — infobox programming language name = Java paradigm = Object oriented, structured, imperative year = 1995 designer = Sun Microsystems latest release version = Java Standard Edition 6 (1.6.0) latest release date = latest test version = latest test… …   Wikipedia

  • Java Class Library — The Java Class Library is a set of dynamically loadable libraries that Java applications can call at runtime. Because the Java Platform is not dependent on any specific operating system, applications cannot rely on any of the existing libraries.… …   Wikipedia

  • Internet Foundation Classes — The Internet Foundation Classes (IFC) were a graphics library for Java originally developed by Netcode Corporation and first released by Netscape Corporation on December 16 1996.HistoryOn April 2 1997, Sun Microsystems and Netscape announced… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”