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.

Was it helpful?

Solution

whiteJLabel.setBackground(Color.WHITE)
whiteJLabel.setOpaque(true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top