Radiance decoration areas are a powerful mechanism that allows visual delineation of logical grouping of controls in your application.
Due to technical reasons detailed in this bug, selection (text highlight) visuals in text components do not work well across decoration areas in some of the Radiance skins, especially those that mix light and dark visuals.
In order to have consistent visual appearance of selection highlights, Radiance provides classes that extend the core Swing text components in the org.pushingpixels.radiance.theming.api.text
package.
For example, instead of using the core JTextField
, use RadianceTextField
:
JPanel panelFooter = new JPanel(new FlowLayout());
RadianceThemingCortex.ComponentOrParentChainScope.setDecorationType(
panelFooter, RadianceThemingSlices.DecorationAreaType.FOOTER);
panelFooter.add(new RadianceTextField("sample footer", 20));
Here is how text selection highlights look like when you use the Radiance-provided text components. This is under the Dust skin:
This is under the Magellan skin:
This is under the Sentinel skin: