Java Color Value setDefaultColor()

Here you can find the source of setDefaultColor()

Description

set Default Color

License

Open Source License

Declaration

static void setDefaultColor() 

Method Source Code


//package com.java2s;
// it under the terms of the GNU General Public License as published by

import javax.swing.*;
import java.awt.*;

public class Main {
    static void setDefaultColor() {

        final Color hsqlBlue = new Color(102, 153, 204);
        final Color hsqlGreen = new Color(153, 204, 204);
        final UIDefaults d = UIManager.getLookAndFeelDefaults();

        d.put("MenuBar.background", SystemColor.control);
        d.put("Menu.background", SystemColor.control);
        d.put("Menu.selectionBackground", hsqlBlue);
        d.put("MenuItem.background", SystemColor.menu);
        d.put("MenuItem.selectionBackground", hsqlBlue);
        d.put("Separator.foreground", SystemColor.controlDkShadow);
        d.put("Button.background", SystemColor.control);
        d.put("CheckBox.background", SystemColor.control);
        d.put("Label.background", SystemColor.control);
        d.put("Label.foreground", Color.black);
        d.put("Panel.background", SystemColor.control);
        d.put("PasswordField.selectionBackground", hsqlGreen);
        d.put("PasswordField.background", SystemColor.white);
        d.put("TextArea.selectionBackground", hsqlGreen);
        d.put("TextField.background", SystemColor.white);
        d.put("TextField.selectionBackground", hsqlGreen);
        d.put("TextField.background", SystemColor.white);
        d.put("ScrollBar.background", SystemColor.controlHighlight);
        d.put("ScrollBar.foreground", SystemColor.control);
        d.put("ScrollBar.track", SystemColor.controlHighlight);
        d.put("ScrollBar.trackHighlight", SystemColor.controlDkShadow);
        d.put("ScrollBar.thumb", SystemColor.control);
        d.put("ScrollBar.thumbHighlight", SystemColor.controlHighlight);
        d.put("ScrollBar.thumbDarkShadow", SystemColor.controlDkShadow);
        d.put("ScrollBar.thumbLightShadow", SystemColor.controlShadow);
        d.put("ComboBox.background", SystemColor.control);
        d.put("ComboBox.selectionBackground", hsqlBlue);
        d.put("Table.background", SystemColor.white);
        d.put("Table.selectionBackground", hsqlBlue);
        d.put("TableHeader.background", SystemColor.control);

        // This doesn't seem to work.
        d.put("SplitPane.background", SystemColor.control);
        d.put("Tree.selectionBackground", hsqlBlue);
        d.put("List.selectionBackground", hsqlBlue);
    }// www. jav  a 2  s .c  o  m
}

Related

  1. getTitleLineBorderColor()
  2. getUIColor(String code)
  3. getValidFieldColor()
  4. getXpHeaderColor(int type, boolean fill)
  5. listUIColorResources()