swing 风格 LookAndFeel

本文介绍了如何使用Java Swing库中的UIManager来设置不同的用户界面风格,包括系统默认风格、Windows风格、Mac风格、跨平台风格、Java原生Metal风格、新式Nimbus风格以及Motif风格等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//当前系统风格

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");//windows风格

UIManager.setLookAndFeel("javax.swing.plaf.windows.WindowsLookAndFeel");//windows风格

UIManager.setLookAndFeel("com.apple.mrj.swing.MacLookAndFeel");//现在在我的机器上没有特殊显示,有待有兴趣的朋友考察,并多谢告知

UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());//跨平台的Java界面风格,不太明白这种说法

UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");//java风格


UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");//Nimbus风格,新出来的外观,jdk6 update10版本以后的才会出现

UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");//Motif风格,外观接近windows经典,但宽宽大大,而且不是黑灰主色,而是蓝黑

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值