Override UIManager value for single object
-
28-06-2021 - |
Question
Is it possible to override the UIManager
properties for specific objects?
For example, my UI Manager has
[Label.background] => (ColorUIResource) [javax.swing.plaf.ColorUIResource[r=238,g=238,b=238]]
I want to make ONE JLabel
with a Color.WHITE
background.
whiteJLabel.setBackground(Color.WHITE)
..has no effect.
Solution
whiteJLabel.setBackground(Color.WHITE)
whiteJLabel.setOpaque(true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow