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.&l开发者_开发百科t;init>(Atalk.java:139)
at com.talk.Atalk.main(Atalk.java:1214)
Why I'm getting this error? How can I solve this?
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.
Ok I have solved it.
Instead of using loadSkin()
I use loadThemePack()
and all works fine.
精彩评论