Java Color Value getTextForegroundColor()

Here you can find the source of getTextForegroundColor()

Description

Method to get the Synthetica text foreground color.

License

Open Source License

Declaration

public static Color getTextForegroundColor() 

Method Source Code


//package com.java2s;
/*/*from  w w  w. j a v a 2  s.c om*/
* Copyright 2004 - 2008 Christian Sprajc. All rights reserved.
*
* This file is part of PowerFolder.
*
* PowerFolder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*
* PowerFolder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PowerFolder. If not, see <http://www.gnu.org/licenses/>.
*
* $Id: ColorUtil.java 6135 2008-12-24 08:04:17Z harry $
*/

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

public class Main {
    /**
     * Method to get the Synthetica text foreground color. This is not the same
     * color as normal getForeground().
     *
     * @return
     */
    public static Color getTextForegroundColor() {
        Object object = UIManager.getColor("Label.foreground");
        Color color;
        if (object != null && object instanceof Color) {
            color = (Color) object;
        } else {
            // Fall back, in case of UIManager problem.
            color = new JLabel().getForeground();
        }
        return color;
    }
}

Related

  1. getMediumDarkColor()
  2. getNimbusDisabledTextColor()
  3. getRolloverColor()
  4. getSubstanceColor(String name)
  5. getTextColor()
  6. getTextInactiveTextColor()
  7. getTextPaneLabel(JScrollPane jsp, Color textColor)
  8. getTitleLineBorderColor()
  9. getUIColor(String code)