Color bg = c.getBackground(); if (bg == null || bg instanceof UIResource) c.setBackground(UIManager.getColor(defaultBgName));   Color fg = c.getForeground(); if (fg == null || fg instanceof UIResource) c.setForeground(UIManager.getColor(defaultFgName));
    public static void installColors(JComponent c, String defaultBgName, String defaultFgName)    {    }