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 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 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 default OceanTheme Metal look and feel in JDK 5

The Java platform comes with several bundled look and feels:[1]

  • A default cross-platform look and feel, called Metal (see MetalLookAndFeel). This look and feel comes with several themes:
  • Other cross-platform look and feels:

| url=http://www.jasperpotts.com/blog/category/nimbus/ | title=Nimbus Category | first=Jasper|last=Potts | date=2007-12-07 | accessdate=2008-05-25}}</ref>[2]

  • Platform-dependent look and feels:[3] 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[4][5]
    • 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:

gollark: I too have to write a personal statement! I'm considering enslaving large language models to help write it.
gollark: (although technically there's the osmarks.net status monitor too)
gollark: Simply use exactly one extremely overburdened server, like me.
gollark: I am not accepting feedback on this opinion at the present time.
gollark: Having investigated, I think I side with the fish.

See also

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.