当前位置: 首页>>代码示例>>Java>>正文


Java SystemColor.window方法代码示例

本文整理汇总了Java中java.awt.SystemColor.window方法的典型用法代码示例。如果您正苦于以下问题:Java SystemColor.window方法的具体用法?Java SystemColor.window怎么用?Java SystemColor.window使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.SystemColor的用法示例。


在下文中一共展示了SystemColor.window方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import java.awt.SystemColor; //导入方法依赖的package包/类
@Override
void initialize() {
    super.initialize();
    insets_ = new Insets(0,0,0,0);

    Color c = ((Component)target).getBackground();
    if (c == null) {
        c = SystemColor.window;
        ((Component)target).setBackground(c);
        setBackground(c);
    }
    c = ((Component)target).getForeground();
    if (c == null) {
        c = SystemColor.windowText;
        ((Component)target).setForeground(c);
        setForeground(c);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:WPanelPeer.java

示例2: getSystemColors

import java.awt.SystemColor; //导入方法依赖的package包/类
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XComponentPeer.java

示例3: createGraphics

import java.awt.SystemColor; //导入方法依赖的package包/类
public Graphics2D createGraphics() {
    if (c == null) {
        GraphicsEnvironment env =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        return env.createGraphics(this);
    }

    Color bg = c.getBackground();
    if (bg == null) {
        bg = SystemColor.window;
    }

    Color fg = c.getForeground();
    if (fg == null) {
        fg = SystemColor.windowText;
    }

    Font font = c.getFont();
    if (font == null) {
        if (defaultFont == null) {
            defaultFont = new Font("Dialog", Font.PLAIN, 12);
        }
        font = defaultFont;
    }

    return new SunGraphics2D(SurfaceData.getPrimarySurfaceData(this),
                             fg, bg, font);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:29,代码来源:OffScreenImage.java

示例4: getBasicSystemColors

import java.awt.SystemColor; //导入方法依赖的package包/类
private Object[] getBasicSystemColors() {
    Object[] basicSystemColors = {"desktop", SystemColor.desktop,
                                  "activeCaption", SystemColor.activeCaption,
                                  "activeCaptionText", SystemColor.activeCaptionText,
                                  "activeCaptionBorder", SystemColor.activeCaptionBorder,
                                  "inactiveCaption", SystemColor.inactiveCaption,
                                  "inactiveCaptionText", SystemColor.inactiveCaptionText,
                                  "inactiveCaptionBorder", SystemColor.inactiveCaptionBorder,
                                  "window", SystemColor.window,
                                  "windowBorder", SystemColor.windowBorder,
                                  "windowText", SystemColor.windowText,
                                  "menu", SystemColor.menu,
                                  "menuText", SystemColor.menuText,
                                  "text", SystemColor.text,
                                  "textText", SystemColor.textText,
                                  "textHighlight", SystemColor.textHighlight,
                                  "textHighlightText", SystemColor.textHighlightText,
                                  "textInactiveText", SystemColor.textInactiveText,
                                  "control", SystemColor.control,
                                  "controlText", SystemColor.controlText,
                                  "controlHighlight", SystemColor.controlHighlight,
                                  "controlLtHighlight", SystemColor.controlLtHighlight,
                                  "controlShadow", SystemColor.controlShadow,
                                  "controlDkShadow", SystemColor.controlDkShadow,
                                  "scrollbar", SystemColor.scrollbar,
                                  "info", SystemColor.info,
                                  "infoText", SystemColor.infoText };
    return basicSystemColors;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:BasicLookAndFeel.java

示例5: makeColors

import java.awt.SystemColor; //导入方法依赖的package包/类
static public void makeColors ()
{
	if (haveParameter("color.background"))
		Background = getParameter("color.background", Color.gray.brighter());
	else Background = SystemColor.window;
	if (haveParameter("color.control"))
		ControlBackground = getParameter("color.control", Color.gray
			.brighter());
	else ControlBackground = SystemColor.control;
}
 
开发者ID:Zenigata,项目名称:jago,代码行数:11,代码来源:Global.java

示例6: init

import java.awt.SystemColor; //导入方法依赖的package包/类
void init (Font f)
{
	F = f;
	FM = getFontMetrics(F);
	Leading = FM.getLeading()
		+ Global.getParameter("fixedfont.spacing", -1);
	Height = FM.getHeight();
	Ascent = FM.getAscent();
	Descent = FM.getDescent();
	Widths = FM.getWidths();
	if (Global.Background != null)
		Background = Global.Background;
	else Background = SystemColor.window;
}
 
开发者ID:Zenigata,项目名称:jago,代码行数:15,代码来源:TextDisplay.java

示例7: getBackground

import java.awt.SystemColor; //导入方法依赖的package包/类
@Override
public Color getBackground ()
{
	if (Global.Background != null)
		return Global.Background;
	else return SystemColor.window;
}
 
开发者ID:Zenigata,项目名称:jago,代码行数:8,代码来源:TextDisplay.java

示例8: getInactiveTextFieldColor

import java.awt.SystemColor; //导入方法依赖的package包/类
public static Color getInactiveTextFieldColor() {
	if (isMac()) 
		return SystemColor.window;
	else
		return UIManager.getColor("TextField.inactiveBackground");
}
 
开发者ID:pavel4n,项目名称:wowdoge.org,代码行数:7,代码来源:Version.java


注:本文中的java.awt.SystemColor.window方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。