Here you can find the source of installColors(Component c, Color background, Color foreground)
public static void installColors(Component c, Color background, Color foreground)
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.awt.Component; import javax.swing.plaf.UIResource; public class Main { public static void installColors(Component c, Color background, Color foreground)/* www .j a va 2 s.co m*/ /* */{ /* 2337 */Color bg = c.getBackground(); /* 2338 */if ((background != null) && ((bg == null) || ((bg instanceof UIResource)))) { /* 2339 */c.setBackground(background); /* */} /* */ /* 2342 */Color fg = c.getForeground(); /* 2343 */if ((foreground != null) && ((fg == null) || ((fg instanceof UIResource)))) /* 2344 */c.setForeground(foreground); /* */} }