里面没有说明吗?我想加入classpath,应该就可以用了吧?

解决方案 »

  1.   

    try {
    UIDefaults defaults = UIManager.getDefaults();//取JVM中UI管理器默认值
    Enumeration e = defaults.keys();
    while (e.hasMoreElements()) {
    Font myFont = new Font("宋体", Font.PLAIN, 12);
    Object o = e.nextElement();
    if (o instanceof String) { // cast之前先检查其类型
    String key = (String) o;
    if (key.indexOf("font") != -1)
    UIManager.put(key, myFont);//启动本次启动界面字体信息
    }
    }
        //设置界面默认布局
        //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        //其它第三方包布局--Alloy.jar
        //com.incors.plaf.kunststoff.themes.KunststoffPresentationTheme之类都是Alloy.jar包提供的类
        UIManager.installLookAndFeel("KunststoffPresentationTheme",
                                     "com.incors.plaf.kunststoff.themes.KunststoffPresentationTheme");
        UIManager.installLookAndFeel("KunststoffTabbedPaneUI",
                                     "com.incors.plaf.kunststoff.themes.KunststoffTabbedPaneUI");
        UIManager.installLookAndFeel("KunststoffTableHeaderUI",
                                     "com.incors.plaf.kunststoff.themes.KunststoffTableHeaderUI");
        UIManager.setLookAndFeel(new KunststoffLookAndFeel());        
    } catch (Exception e) {
         e.printStackTrace();
    }