Here you can find the source of installColorsAndFont(Component c, Color background, Color foreground, Font font)
public static void installColorsAndFont(Component c, Color background, Color foreground, Font font)
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.awt.Component; import java.awt.Font; import javax.swing.plaf.UIResource; public class Main { public static void installColorsAndFont(Component c, Color background, Color foreground, Font font) /* */{//from w w w . ja v a 2s .com /* 2324 */installFont(c, font); /* 2325 */installColors(c, background, foreground); /* */} public static void installFont(Component c, Font font) { /* 2329 */Font f = c.getFont(); /* 2330 */if ((f == null) || ((f instanceof UIResource))) /* 2331 */c.setFont(font); /* */} public static void installColors(Component c, Color background, Color foreground) /* */{ /* 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); /* */} }