How to get default background color of swing components? I mean default background color of JPanel?
To get DEFAULT color that panel will use when it is created use:
Color color = UIManager.getColor ( "Panel.background" );
To get CURRENT panel background use:
Color color = panel.getBackground ();
For a complete list of UIManager
colour properties, see http://alvinalexander.com/java/java-uimanager-color-keys-list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With