可以使用substance改变界面的皮肤和主题,让Java制作的界面“炫”起来
。
可以下载substance.jar文件
在代码中你可以用:
- static {
- try {
- try {
- UIManager.setLookAndFeel(new SubstanceLookAndFeel());
- } catch (UnsupportedLookAndFeelException ex) {
- System.out.println(ex.getMessage());
- }
- } catch (Exception ex) {
- System.out.println(ex.getMessage());
- }
- //设置皮肤
- // SubstanceSaharaLookAndFeel.setSkin(new CremeSkin());
- SubstanceSaharaLookAndFeel.setSkin(new AutumnSkin());
- //SubstanceSaharaLookAndFeel.setCurrentButtonShaper(new StandardButtonShaper());
- //SubstanceSaharaLookAndFeel.setFontPolicy(new DefaultMacFontPolicy());
- //设置水印
- SubstanceLookAndFeel.setCurrentWatermark(new SubstanceBubblesWatermark());
- //设置主题
- // SubstanceLookAndFeel.setCurrentTheme(new SubstanceCremeTheme());
- SubstanceLookAndFeel.setCurrentTheme(new SubstanceLightAquaTheme());
- // SubstanceLookAndFeel.setCurrentTheme(new SubstanceOliveTheme());
- // SubstanceLookAndFeel.setCurrentTheme(new SubstanceJadeForestTheme());
- //设置题头
- SubstanceLookAndFeel.setCurrentTitlePainter(new Glass3DTitlePainter());
下载下来substance.jar包后,解压JAR文件,可以看到在“org/jvnet/substance/skin”下有下面这些皮肤(以LookAndFeel.class结尾的文件)。
共有22种皮肤,69种主题,自己设置
我给你个地址吧,上面全是开源的外观,可以直接拿来用,很方便
http://www.open-open.com/61.htm
http://www.iteye.com/problems/70945
时间: 2024-10-27 05:42:42