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


Java LookAndFeel.getName方法代码示例

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


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

示例1: applyNbSkin

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
static void applyNbSkin() {
    LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
    String name = lookAndFeel.getName();
    switch (name) {
        case "Mac OS X":
            name = "mac";
            break;
        case "Metal":
            name = "metal";
            break;
        case "GTK look and feel":
            name = "gtk";
            break;
        case "Nimbus":
            name = "nimbus";
            break;
        case "Windows":
            name = "win";
            break;
        case "Darcula":
            name = "darcula";
            break;
    }
    final String resource = "nbres:/org/netbeans/modules/htmlui/css/wizard-" + name + ".css";
    loadCss(resource);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:NbBrowsers.java

示例2: paintComponent

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void paintComponent(Graphics graphics) {
	// Surchargée pour dessiner le fond avec gradient
	final LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
	final String lafName = lookAndFeel != null ? lookAndFeel.getName() : null;
	if ("Substance".equals(lafName)) {
		super.paintComponent(graphics); // le gradient fonctionne mal en substance ?
	}

	final Color startColor = getBackground();
	final Color endColor = GRADIENT_COLOR;
	final int w = getWidth();
	final int h = getHeight();

	// l'image du gradient pourrait être mise en cache, mais ce n'est pas grave
	final Paint paint = new GradientPaint(0, h / 2f, startColor, 1, h, endColor, false);
	final Graphics2D graphix = (Graphics2D) graphics.create();
	graphix.setPaint(paint);
	graphix.fillRect(0, 0, w, h);
	graphix.dispose();
}
 
开发者ID:evernat,项目名称:dead-code-detector,代码行数:23,代码来源:DeadCodeDetectorUI.java

示例3: updateLookAndFeels

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
protected void updateLookAndFeels()
   {
clearButtons();
LookAndFeel currentLookAndFeel = UIManager.getLookAndFeel();
String current = currentLookAndFeel == null ? "" : currentLookAndFeel.getName();
LookAndFeelInfo[] infoArray = UIManager.getInstalledLookAndFeels();
if (infoArray == null || infoArray.length == 0) {
    return;
}

for (LookAndFeelInfo info : infoArray) {
    JRadioButtonMenuItem button = new JRadioButtonMenuItem(info.getName());
    button.setActionCommand(info.getClassName());
    if (info.getName().equals(current))
	button.setSelected(true);
    addButton(button);
}
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:19,代码来源:LookAndFeelMenuItem.java

示例4: createPanelJava

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
private JPanel createPanelJava()
{
    StringBuilder buffer = new StringBuilder(256);
    String name = Platform.getJavaRuntimeName();
    buffer.append("<p align=\"center\"><img src=\""
                  + getImage("java.png") + "\"></p>");
    if (name == null)
    {
        buffer.append("<p align=\"center\">");
        XmlUtil.escapeText(i18n("MSG_ABOUT_UNKNOWN_JAVA"));
        buffer.append("</p>");
    }
    else
    {
        buffer.append("<p align=\"center\"><b>");
        buffer.append(name);
        buffer.append("</b></p>");
        String version = System.getProperty("java.version");
        if (version != null)
        {
            buffer.append("<p align=\"center\">");
            buffer.append(XmlUtil.escapeText(format(i18n("MSG_ABOUT_VERSION"), version)));
            buffer.append("</p>");
        }
        buffer.append("<p align=\"center\">");
        String vendor = System.getProperty("java.vm.vendor");
        if (vendor != null)
            buffer.append(vendor);
        buffer.append("<br>");
    }
    Runtime runtime = Runtime.getRuntime();
    long max = runtime.maxMemory();
    String maxString =
        (max == Long.MAX_VALUE ? i18n("LB_ABOUT_MEMORYLIMIT_NONE")
         : getMemorySizeString(max));
    buffer.append(XmlUtil.escapeText(i18n("LB_ABOUT_JAVA_MEMLIMIT")));
    buffer.append(' ');
    buffer.append(XmlUtil.escapeText(maxString));
    buffer.append("<br>");
    buffer.append(XmlUtil.escapeText(format(i18n("LB_ABOUT_JAVA_MEMLIMIT_1"),
                                            getMemorySizeString(runtime.totalMemory()),
                                            getMemorySizeString(runtime.freeMemory()))));
    String lafName = i18n("LB_ABOUT_LAF_UNKNOWN");
    LookAndFeel laf = UIManager.getLookAndFeel();
    if (laf != null)
        lafName = laf.getName();
    buffer.append("<br>");
    buffer.append(XmlUtil.escapeText(i18n("LB_ABOUT_LAF")));
    buffer.append(' ');
    buffer.append(lafName);
    return createPanel(buffer.toString());
}
 
开发者ID:havkarl,项目名称:gogui2,代码行数:53,代码来源:AboutDialog.java


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