【问题标题】:Exception in loading Skin加载皮肤异常
【发布时间】:2011-02-21 05:01:55
【问题描述】:

我正在使用 SkinLookAndFeel 并想使用 SkinLookAndFeel 的水色主题包。我已经下载了 sklf.jar 和 aquathemepack.zip。这是我的代码:

        Skin skin = SkinLookAndFeel.loadSkin("aquathemepack.zip");
        SkinLookAndFeel.setSkin(skin);
        UIManager.setLookAndFeel(new SkinLookAndFeel());

例外是:

java.lang.Exception: Unable to load this skin file:/C:/Workspaces/Demo_Swing/Demo/aquathemepack.zip (by using filename matching),  try an explicit constructor
    at com.l2fprod.gui.plaf.skin.SkinLookAndFeel.loadSkin(SkinLookAndFeel.java:902)
    at com.l2fprod.gui.plaf.skin.SkinLookAndFeel.loadSkin(SkinLookAndFeel.java:883)
    at com.talk.Atalk.<init>(Atalk.java:139)
    at com.talk.Atalk.main(Atalk.java:1214)

为什么我会收到此错误?我该如何解决这个问题?

【问题讨论】:

    标签: java exception look-and-feel


    【解决方案1】:

    SkinLookAndFeel.loadSkin(String) 方法需要一个以“gtkrc”或“.themerc”结尾的文件名。源码是here...有没有你想看的。

    【讨论】:

      【解决方案2】:

      好的,我已经解决了。

      我没有使用loadSkin(),而是使用loadThemePack(),一切正常。

      【讨论】:

        猜你喜欢
        • 2016-05-23
        • 2017-04-27
        • 1970-01-01
        • 1970-01-01
        • 2019-07-03
        • 2019-04-27
        • 2016-07-12
        • 2016-09-12
        • 1970-01-01
        相关资源
        最近更新 更多