加载皮肤异常

发布于 2024-10-18 11:34:48 字数 777 浏览 3 评论 0原文

我正在使用 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)

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

I'm using SkinLookAndFeel and want to use the aqua theme pack of SkinLookAndFeel. I've downloaded sklf.jar and aquathemepack.zip. Here is my code:

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

and the exception is:

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)

Why I'm getting this error? How can I solve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千笙结 2024-10-25 11:34:48

SkinLookAndFeel.loadSkin(String) 方法需要一个以“gtkrc”或“.themerc”结尾的文件名。源代码位于此处 ..是你想看一下吗?

The SkinLookAndFeel.loadSkin(String) method expects a file name that ends with either "gtkrc" or ".themerc". The source code is here ... is you want to take a look.

第七度阳光i 2024-10-25 11:34:48

好吧,我已经解决了。

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

Ok I have solved it.

Instead of using loadSkin() I use loadThemePack() and all works fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文