Jump to content

Pluggable look and feel

From Alfawiki

Pluggable look and feel refers to a feature within the Java Swing widget toolkit that permits altering the look and feel of the graphical user interface during program execution.

Swing supports modifying the visual style of widgets by changing the default look and feel through runtime settings, extending existing designs, developing new ones, or, starting with J2SE 5.0, employing the skinnable synth look and feel, which is configured using an XML properties file. This mechanism allows for dynamic switching of the interface appearance.

Architecture

The framework provides:

  • Integration points within Swing widgets that delegate their rendering tasks to corresponding UI delegates.
  • An interface to control and toggle between different look-and-feel implementations while the application is running.
  • Tools to create or customize particular look and feel themes.

Platform look and feels

The Java platform includes multiple built-in look and feels:

  • The standard cross-platform look and feel named Metal (MetalLookAndFeel) featuring themes such as:
    • , the original default for Swing.
    • , a refined theme that became the default starting with Java 5.0.
  • Additional cross-platform alternatives:
    • The configurable, skinnable synth, defined through XML files.
    • The look and feel based on synth, introduced in Java SE 6 Update 10.
  • Platform-specific look and feels designed to closely replicate native user interfaces by utilizing native theming libraries:
    • A Windows-specific style adapting to various OS versions.
    • Motif or GTK+ styles for Linux or Solaris environments.
    • Custom vendor-specific looks for IBM AIX, HP-UX, and Mac OS X.

Third-party look and feels

Numerous third-party look and feel options have been created, including:

  • FlatLaf, an open-source flat design supporting HiDPI scaling for JDK8 and newer.
  • Insubstantial, a maintained fork derived from Substance.
  • JGoodies, providing Windows-like and plastic themes.
  • Liquid, inspired by the Liquid theme from KDE.
  • Napkin, which offers a sketch-like, hand-drawn visual style.
  • Substance, a skinnable appearance framework.
  • Synthetica, based on the synth architecture.

See also

External links