加载皮肤异常
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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.好吧,我已经解决了。
我没有使用
loadSkin()
,而是使用loadThemePack()
并且一切正常。Ok I have solved it.
Instead of using
loadSkin()
I useloadThemePack()
and all works fine.