Permalink
Switch branches/tags
Find file Copy path
133e663 Aug 28, 2018
1 contributor

Users who have contributed to this file

48 lines (28 sloc) 4.26 KB

Substance look and feel

Getting started

If you are new to Swing, start with the general Swing tutorial. If you are new to look-and-feels, read the getting started first.

To use Substance in your applications, use one of the following options:

  • Call UIManager.setLookAndFeel() with one of the skin-based look-and-feel classes (light or dark).
  • Extend the SubstanceLookAndFeel class and pass a SubstanceSkin instance to the super constructor.
  • Use the static setSkin(SubstanceSkin) or setSkin(String) APIs in SubstanceCortex.GlobalScope to set the specific skin.

The main demo application in the substance-demo uses the FormLayout. In addition, substance-samples has a collection of self-contained samples that show more advanced usage of Substance APIs for custom application skinning.

Have a question? See the FAQ and the list of known issues, and if you don't see an answer there, file a bug or get in touch.

Adding Substance to your application

Snapshot artifacts are available on Sonatype for Maven and Gradle builds. Another option is to:

  • Download the local copy of the latest Radiance.
  • Build Radiance locally with gradlew command.
  • Copy the binaries with gradlew copyJars command. For version X.Y.ZZ of Radiance, add radiance-substance-X.Y.ZZ.jar, radiance-trident-X.Y.ZZ.jar and radiance-neon-X.Y.ZZ.jar to the place that has your local dependencies.

For earlier versions of Substance, see this page for the list of binaries to take for the specific pre-Radiance versions.

Configure and customize

It is easy to customize and extend Substance to fit your visual needs.

Substance comes with an extensive set of APIs to add custom functionality to your components. The overall visuals are controlled by skins, with each skin defined by color scheme bundles and painters.

The skinning primer has a few tips on how to use the different Substance painters in applications that wish to paint custom components in a way that is consistent with other Substance visuals. The substance-samples sub-project provides additional self-contained mini-applications that show more advanced usage of Substance APIs for pixel-perfect skinning.

Plugins

While the core Swing components cover the base UI functionality that most applications require, modern UIs need modern UI components. To address this need, Substance comes with a built-in support to define and load plugins that provide consistent appearance and interaction patterns for third-party components.

During the initialization of your application in the main() method - before creating your first window - use these SubstanceCortex.GlobalScope APIs to register plugins:

  • registerComponentPlugin() for registering component plugins
  • registerSkinPlugin() for registering skin plugins

Substance Extras pack provides additional watermarks, color schemes and skins.