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


Java UIDefaults.getColor方法代碼示例

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


在下文中一共展示了UIDefaults.getColor方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureScrollBarColors

import javax.swing.UIDefaults; //導入方法依賴的package包/類
@Override
protected void configureScrollBarColors() {
    UIDefaults uidefaults = XToolkit.getUIDefaults();
    Color bg = scrollbar.getBackground();
    if (bg == null || bg instanceof UIResource) {
        scrollbar.setBackground(uidefaults.getColor("ScrollBar.background"));
    }

    Color fg = scrollbar.getForeground();
    if (fg == null || fg instanceof UIResource) {
        scrollbar.setForeground(uidefaults.getColor("ScrollBar.foreground"));
    }

    thumbHighlightColor = uidefaults.getColor("ScrollBar.thumbHighlight");
    thumbLightShadowColor = uidefaults.getColor("ScrollBar.thumbShadow");
    thumbDarkShadowColor = uidefaults.getColor("ScrollBar.thumbDarkShadow");
    thumbColor = uidefaults.getColor("ScrollBar.thumb");
    trackColor = uidefaults.getColor("ScrollBar.track");

    trackHighlightColor = uidefaults.getColor("ScrollBar.trackHighlight");

}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:23,代碼來源:XTextAreaPeer.java

示例2: setDefaultColors

import javax.swing.UIDefaults; //導入方法依賴的package包/類
protected void setDefaultColors()
   {
UIDefaults defaults = UIManager.getDefaults();
ComponentName componentKey = getComponentName();
background = defaults.getColor(backgrounds.get(componentKey));
border = defaults.getColor(borders.get(componentKey));
darkShadow = defaults.getColor(darkShadows.get(componentKey));
disabledForeground = defaults.getColor(disabledForegrounds.get(componentKey));
disabledBackground = defaults.getColor(disabledBackgrounds.get(componentKey));
focus = defaults.getColor(focuses.get(componentKey));
foreground = defaults.getColor(foregrounds.get(componentKey));
highlight = defaults.getColor(highlights.get(componentKey));
light = defaults.getColor(lights.get(componentKey));
selectedForeground = defaults.getColor(selectedForegrounds.get(componentKey));
selectedBackground = defaults.getColor(selectedBackgrounds.get(componentKey));
shadow = defaults.getColor(shadows.get(componentKey));
   }
 
開發者ID:nomencurator,項目名稱:taxonaut,代碼行數:18,代碼來源:DefaultColors.java

示例3: setupUI

import javax.swing.UIDefaults; //導入方法依賴的package包/類
/**
 * Set up the user interface.
 */
public static void setupUI() {
    try {
        final String classname = UIManager.getSystemLookAndFeelClassName();
        UIManager.setLookAndFeel(classname);
    }
    catch (Exception e) { 
        e.printStackTrace();
    }

    final UIDefaults defaults = UIManager.getDefaults();

    defaults.put(
        "PopupMenu.border", 
        new BorderUIResource.EtchedBorderUIResource(
            EtchedBorder.RAISED, defaults.getColor("controlShadow"), 
            defaults.getColor("controlLtHighlight")
        )
    );

    final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black);
    final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control"));
    final BorderUIResource.CompoundBorderUIResource compBorder
        = new BorderUIResource.CompoundBorderUIResource(emptyborder, matteborder);
    final BorderUIResource.EmptyBorderUIResource emptyBorderUI
        = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
    defaults.put("SplitPane.border", emptyBorderUI);
    defaults.put("Table.scrollPaneBorder", emptyBorderUI);
    defaults.put("ComboBox.border", compBorder);
    defaults.put("TextField.border", compBorder);
    defaults.put("TextArea.border", compBorder);
    defaults.put("CheckBox.border", compBorder);
    defaults.put("ScrollPane.border", emptyBorderUI);

}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:38,代碼來源:UIUtilities.java


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