當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。