dcsimg
Getting Primary and Secondary theme colours
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rick_Barkhouse
Posted On:   Thursday, March 29, 2001 05:33 AM

Is there an easy way to find out the Metal theme's primary and secondary colours? I am writing a custom component and want to make sure I use colours that match the rest of the theme.

Re: Getting Primary and Secondary theme colours

Posted By:   Sandip_Chitale  
Posted On:   Thursday, March 29, 2001 10:11 AM



if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) {
MetalTheme mt = (()UIManager.getLookAndFeel()).getCurrentTheme();

// The following is true for DefaultMetalTheme
// primary 1
mt.getPrimaryControlDarkShadow();
// primary 2
mt.getControlShadow();
// primary 3
mt.getPrimaryControl();


// secondary 1
mt.getControlDarkShadow();
// secondary 2
mt.getPrimaryControlShadow();
// secondary 3
mt.getControl();
}




You should study the SwingSet example also...


Looking at the JDK sources might also help.

About | Sitemap | Contact