Jump to content

Pluggable look and feel

From Wikipedia, the free encyclopedia

Pluggable look and feelis a mechanism used in theJavaSwingwidget toolkitallowing to change thelook and feelof thegraphical user interfaceat runtime.

Swing allows an application 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 withJ2SE 5.0,by using theskinnablesynthlook and feel, which is configured with anXMLproperty file. The look and feel can be changed at runtime.

Architecture[edit]

The correspondingAPIincludes:

  • HooksinSwingwidgetsto interact with their look and feel. Each widget defined in Swing can delegate its "painting" to its associateduser interfaceclasses calledUI 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[edit]

Platform look and feels[edit]

The default OceanTheme Metal look and feel in JDK 5

TheJava platformcomes with several bundled look and feels:[1]

  • A defaultcross-platformlook and feel, calledMetal(seeMetalLookAndFeel). This look and feel comes with severalthemes:
  • Other cross-platform look and feels:
  • Platform-dependent look and feels:[4]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 GUItheminglibrary when possible[5][6]

Third-party look and feels[edit]

Numerous other look and feels have been developed by third parties, such as:

See also[edit]

References[edit]

  1. ^"Java Tutorials: Available Look and Feels".Sun Microsystems.2008-02-14.Archivedfrom the original on 2010-08-22.Retrieved2008-05-25.
  2. ^Potts, Jasper (2007-12-07)."Nimbus Category".Archivedfrom the original on 2008-05-17.Retrieved2008-05-25.
  3. ^"Nimbus".Sun Microsystems.Archived fromthe originalon 2008-05-13.Retrieved2008-05-25.
  4. ^"Available Look and Feels".Sun Microsystems.Archivedfrom the original on 2008-05-29.Retrieved2008-05-25.
  5. ^"GTK Native L&F Fidelity".Sun Microsystems.Archivedfrom the original on 2008-04-29.Retrieved2008-05-25.
  6. ^"XP L&F does not work on Windows Vista (Longhorn) - needs to use uxtheme api".Sun Microsystems.Archivedfrom the original on 2008-04-29.Retrieved2008-05-25.

External links[edit]