Substance look and feel
To use Substance in your applications, use one of the following options:
UIManager.setLookAndFeel()with one of the skin-based look-and-feel classes (light or dark).
- Extend the
SubstanceLookAndFeelclass and pass a
SubstanceSkininstance to the super constructor.
- Use the static
SubstanceCortex.GlobalScopeto 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.
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
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.
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.