Sponsored Links
-->

Saturday, December 30, 2017

Lesson 28 GUI Components, Part 2 Pluggable look and feel - YouTube
src: i.ytimg.com

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.


Video Pluggable look and feel



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.

Maps Pluggable look and feel



Examples of look and feels

Platform look and feels

The Java platform comes with several bundled look and feels:

  • A default cross-platform look and feel, called Metal (see MetalLookAndFeel). This look and feel comes with several themes:
    • The DefaultMetalTheme, which was historically the first Swing default theme.
    • The smoother OceanTheme, which became the default theme for Java 5.0.
  • Other cross-platform look and feels:
    • A skinnable look and feel called synth (see 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.
  • Platform-dependent look and feels: 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
    • 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:

  • Insubstantial, a maintenance fork of Substance
  • JGoodies, Windows and plastic look and feels
  • Liquid, which aim to look like the Liquid theme for KDE
  • Napkin, which can be used to make GUI work look provisional
  • Substance, a skinnable look and feel
  • Synthetica, based on synth

Napkin Look & Feel
src: napkinlaf.sourceforge.net


See also

  • Look and feel
  • Swing

Java Swing Tutorial #3 - How to change Look and Feel - YouTube
src: i.ytimg.com


References


Napkin Look & Feel
src: napkinlaf.sourceforge.net


External links

  • List of Java look and feels
  • Oracle's tutorial on setting the look and feel in Java
  • Oracle's tutorial overview of the pluggable look and feel mechanism
  • Swing pluggable look and feel architecture
  • Swing pluggable look and feel links at Curlie (based on DMOZ)

Source of the article : Wikipedia

Comments
0 Comments