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


Java LookAndFeelInfo.getClassName方法代码示例

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


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

示例1: getLookAndFeelClassName

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
/**
 * Returns the class name of the installed LookAndFeel with a name
 * containing the name snippet or null if none found.
 * 
 * @param nameSnippet
 * @return
 */
public static String getLookAndFeelClassName(String nameSnippet) {
    LookAndFeelInfo[] plafs = UIManager.getInstalledLookAndFeels();
    for (LookAndFeelInfo info : plafs) {
        if (info.getName().contains(nameSnippet)) {
            return info.getClassName();
        }
    }
    return null;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:InteractiveTestCase.java

示例2: getLafIndex

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
private static int getLafIndex(final String searchLafClassName) {
  for (int i = 0; i < lafs.length; i++) {
    final LookAndFeelInfo lookAndFeelInfo = lafs[i];
    final String lafClassName = lookAndFeelInfo.getClassName();
    if (lafClassName.equals(searchLafClassName)) {
      return i;
    }
  }
  return -1;
}
 
开发者ID:UprootLabs,项目名称:swing-htabs,代码行数:11,代码来源:HTabsDemoApp.java

示例3: setLookAndFeel

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
private void setLookAndFeel(LookAndFeelInfo info)
{
	String lookAndFeel = info.getClassName();
	try {
		UIManager.setLookAndFeel(lookAndFeel);
	} catch (Exception e) {
		logger.error("error while setting look and feel '" + lookAndFeel
				+ "': " + e.getClass().getSimpleName() + ", message: "
				+ e.getMessage());
	}
	SwingUtilities.updateComponentTreeUI(this);
	this.pack();
}
 
开发者ID:sebkur,项目名称:live-cg,代码行数:14,代码来源:PreferencesDialog.java

示例4: getLookAndFeelClassName

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
/**
 * Returns the class name of the installed LookAndFeel with a name
 * containing the name snippet or null if none found.
 * 
 * @param nameSnippet a snippet contained in the Laf's name
 * @return the class name if installed, or null
 */
public static String getLookAndFeelClassName(String nameSnippet) {
    LookAndFeelInfo[] plafs = UIManager.getInstalledLookAndFeels();
    for (LookAndFeelInfo info : plafs) {
        if (info.getName().contains(nameSnippet)) {
            return info.getClassName();
        }
    }
    return null;
}
 
开发者ID:happyjack27,项目名称:autoredistrict,代码行数:17,代码来源:MainFrame.java

示例5: main

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
/**
 * Run a conversion or open the application window.
 */
public static void main(String[] args) {
	if (args == null || args.length == 0) {

		// set the look and feel
		// if the Nimbus look and feel is available it is selected
		// otherwise the platforms look and feel is selected
		try {
			String lookAndFeel = null;
			for (LookAndFeelInfo info : UIManager
					.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					UIManager.setLookAndFeel(info.getClassName());
					lookAndFeel = info.getClassName();
					break;
				}
			}
			if (lookAndFeel == null) {
				lookAndFeel = UIManager.getSystemLookAndFeelClassName();
			}
			UIManager.setLookAndFeel(lookAndFeel);
		} catch (Exception e) {
			e.printStackTrace();
		}

		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				ConversionWindow.getInstance().setVisible(true);
			}
		});

	} else {
		// interpret the command line arguments
		if (args[0] != null
				&& (args[0].equals("-h") || args[0].equals("-help"))) {
			printHelp();

		}
	}

}
 
开发者ID:GreenDelta,项目名称:olca-converter,代码行数:44,代码来源:Main.java

示例6: switchLookAndFeelType

import javax.swing.UIManager.LookAndFeelInfo; //导入方法依赖的package包/类
/**
 * Switch Look and Feel. Call this method before creating any Swing GUI. Runtime switching may work, but Windows and
 * Frames must be recreated.
 */
public static boolean switchLookAndFeelType(LookAndFeelType lafType)
{
    // Set Look & Feel
    try
    {

        switch (lafType)
        {
            case NATIVE:
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                break;
            case DEFAULT:
            case METAL:
                javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
                break;
            case WINDOWS:
                javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                break;
            case GTK:
                javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
                break;
            case KDEQT:
                // org.freeasinspeech.kdelaf.KdeLAF
                break;
            case PLASTIC_3D:
                javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
                break;
            case PLASTIC_XP:
                javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
                break;
            case NIMBUS:
            {
                if (nimbusLookAndFeelClassName == null)
                {
                    // name of nimbus package may vary
                    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
                    {
                        if ("Nimbus".equals(info.getName()))
                        {
                            nimbusLookAndFeelClassName = info.getClassName();
                            break;
                        }
                    }
                }
                javax.swing.UIManager.setLookAndFeel(nimbusLookAndFeelClassName);
                break;
            }
            default:
                return false;
                // break;
        }
    }
    catch (Exception e)
    {
        e.printStackTrace();
        return false;
    }

    return true;
}
 
开发者ID:NLeSC,项目名称:escxnat,代码行数:65,代码来源:UIUtil.java


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