當前位置: 首頁>>代碼示例>>Java>>正文


Java SystemColor.windowText方法代碼示例

本文整理匯總了Java中java.awt.SystemColor.windowText方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemColor.windowText方法的具體用法?Java SystemColor.windowText怎麽用?Java SystemColor.windowText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.SystemColor的用法示例。


在下文中一共展示了SystemColor.windowText方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的java.awt.SystemColor.windowText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。