Java JComponent Color installColors(Component c, Color background, Color foreground)

Here you can find the source of installColors(Component c, Color background, Color foreground)

Description

install Colors

License

Open Source License

Declaration

public static void installColors(Component c,
                Color background, Color foreground)
        

Method Source Code

//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);
        /*      */}
}

Related

  1. createTextArea(String str, Color color)
  2. findPanel(JColorChooser chooser, String name)
  3. fixOsxColorChooser(JColorChooser chooser)
  4. flashMessage(final Window parent, String string, Color background, Color foreground, final long howLong)
  5. highlightForDebugging(JComponent component, Color color)
  6. makeEmptyIcon(Dimension size, Color color)
  7. newColorComponent(Color value)
  8. normalize(float q, float p, float color)
  9. recursiveSetBackground(Component comp, Color color)