用美化包设置Java Swing LookAndFeel

介绍:Java Swing的开发中UI的设置和润色比较复杂,简单的方法就是设置LookAndFeel.

 

1.   java自带的

1.Java Swing自带的LookAndFeel可以根据系统名称来设置。

文档:http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

比如:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

2.还可以设置Nimbus Look and Feel

文档http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html


2.   其他美化包

 1.  Seaglass  苹果风格的美化包,跨平台的Java Swing外观,只支持JRE1.6以上运行的环境。

下载地址:https://code.google.com/p/seaglass/

方法:1.下载美化包并添加;

        2.在程序中设置:

UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
UIManager.getLookAndFeelDefaults().put("defaultFont", new Font("Microsoft Yahei",Font.PLAIN,13));

优点是:设计清新自然

缺点是:对中文字符的支持有不少问题。

2.  Substance  包含多类美化风格的美化包

下载地址: https://java.net/projects/substance/

比如:

UIManager.setLookAndFeel(new org.jvnet.substance.skin.SubstanceOfficeSilver2007LookAndFeel());

其他的可以设置的有:

3.   JTattoo包含多个美化风格的美化包

下载地址:http://www.jtattoo.net/Download.html

设置方法:

UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");

其他的还有很多,看完上边的一般就有思路了,下面是一些从网上搜到的java swing美化包的链接,仅供参:

1.  JGoodies                      http://www.jgoodies.com/products/swing-suite/

2.  Jide                             http://www.jidesoft.com/products/

3.  Liquidlnf                      https://java.net/projects/liquidlnf/

4.  Napkin Look & Feel       http://napkinlaf.sourceforge.net/

5.  PgsLookAndFeel            http://www.pagosoft.com/projects/pgslookandfeel/

6.  Quaqua                        http://www.randelshofer.ch/quaqua/index.html

7.  The Alloy Look and Feel                http://lookandfeel.incors.com/

8.  WebLookAndFeel                          http://weblookandfeel.com/

9.  javootoo.com                               http://www.javootoo.com/

10.Synthetica Themes - Custom L&Fs  http://www.javasoft.de/synthetica/themes/

 

3. 另外,如果想要创建自己的Look and Feel,可以参考一下资料:

  1.  How to Write a Custom Look and Feel

  https://today.java.net/pub/a/today/2006/09/12/how-to-write-custom-look-and-feel.html

2.          Modifying the Look and Feel 

        http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/

 2.  Java Look And Feel Libraries/Engines: Cezanne L&F engine

http://www.centigrade.de/en/products/cezanne-look-and-feel-engine


其他相关资料:

·         Best Java Swing Look and Feel Themes | Top 10

·         oracle.com - Modifying the Look and Feel

·         wikipedia.org - Pluggable look and feel

·         Java2s.com - Look and feel

·         Java Look and Feel (L&F)

 

转载于:https://my.oschina.net/liuyuanyuangogo/blog/267720

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值