日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > java >内容正文

java

nimbus java_Java:Swing使用Nimbus皮肤

發布時間:2024/9/19 java 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nimbus java_Java:Swing使用Nimbus皮肤 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Nimbus is the name of a look-and-feel designed by Sun for the Java Desktop System; it’s implemented as a GTK theme in the latest Solaris 11 pre-release builds. In 2007, this project was started by Sun’s Swing Team and Ben Galbraith to build a pure Java implementation of this look and feel under a opensource licence. Later on it was decided to pull Nimbus LAF in to the core of the Java platform as part of version 6u10. Nimbus is now available in the beta version of 6u10 available at?http://download.java.net/jdk6/.

The version in the JDK took some of the concepts that were experimented with in the project but is a complete new codebase. It is still based on Synth LAF but is 100% pure vector based using no images. This project is dead for the time being until Nimbus is made opensource through Open JDK. Once that happens it might be pulled back into the project so that we can work on a backport jar that could run on older Java versions than 6u10.

Nimbus is a new cross-platform Swing look & feel, which packs many features and enhancements. It is not just another look and feel but with some exciting features:2D VectorAll of Nimbus is rendered with 2D vector graphics, there is not one image even for all the icons. This means that the whole of Nimbus is just 56k as a packed JAR which is pretty impressive for a whole rich look and feel.High DPI ReadyAs the whole of Nimbus is drawn with shapes and gradients it can be scaled to any resolution.Based on PaintersAll painting for components is done with simple stateless implementations of the Painter interface. These painters are stored in the UIDefaults table so they can be replaced if you would like to change the look of components or can be used in your own components if you would like to create a custom table header for example that looks the same as the standard Nimbus one plus something extra.CustomizableAll colors, icons and fonts are derived off UIDefaults keys so the whole UI can be customized by changing values in the UIDefaults table.Easy to skin 3rd party components to fit inAll of the colors, fonts, icons, borders and painters are exposed through the UIDefaults table which means they are available to your 3rd party components to help you skin them in a Nimbus style.

Usage

To use the Nimbus Look & Feel, simply call the setLookAndFeel methods from UIManager:try {

UIManager.setLookAndFeel(

"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");

} catch (UnsupportedLookAndFeelException e) {

// handle exception

} catch (ClassNotFoundException e) {

// handle exception

} catch (InstantiationException e) {

// handle exception

} catch (IllegalAccessException e) {

// handle exception

}

Alternatively, you can either specify the L&F from swing.properties file or from a command line. To use the swing.properties files, specify the swing.defaultlaf property. The file (if exists) is located under \lib:# Swing properties

swing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

To specify the L&F from command line, use the following when running your Java application:

-Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

From:?http://javaforweb.wordpress.com/2008/05/05/nimbus-a-new-look-and-feel-for-swing/

總結

以上是生活随笔為你收集整理的nimbus java_Java:Swing使用Nimbus皮肤的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。