substance的使用示例(转)

可以使用substance改变界面的皮肤和主题,让Java制作的界面“炫”起来 
。 
可以下载substance.jar文件 
在代码中你可以用: 

Java代码   收藏代码
  1. static {  
  2.         try {  
  3.             try {  
  4.                 UIManager.setLookAndFeel(new SubstanceLookAndFeel());  
  5.             } catch (UnsupportedLookAndFeelException ex) {  
  6.                System.out.println(ex.getMessage());  
  7.             }  
  8.         } catch (Exception ex) {  
  9.             System.out.println(ex.getMessage());  
  10.         }  
  11.         //设置皮肤  
  12.       //  SubstanceSaharaLookAndFeel.setSkin(new CremeSkin());  
  13.         SubstanceSaharaLookAndFeel.setSkin(new AutumnSkin());  
  14.         //SubstanceSaharaLookAndFeel.setCurrentButtonShaper(new StandardButtonShaper());  
  15.         //SubstanceSaharaLookAndFeel.setFontPolicy(new DefaultMacFontPolicy());  
  16.         //设置水印  
  17.         SubstanceLookAndFeel.setCurrentWatermark(new SubstanceBubblesWatermark());  
  18.         //设置主题  
  19.        // SubstanceLookAndFeel.setCurrentTheme(new SubstanceCremeTheme());  
  20.       SubstanceLookAndFeel.setCurrentTheme(new SubstanceLightAquaTheme());  
  21.      //  SubstanceLookAndFeel.setCurrentTheme(new SubstanceOliveTheme());  
  22.   
  23.      //  SubstanceLookAndFeel.setCurrentTheme(new SubstanceJadeForestTheme());  
  24.         //设置题头  
  25.         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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值