---
title: "新版JRE内置新的LAF：Nimbus，太漂亮了！"
author: "yipsilon"
date: "2010-01-26T18:31:12Z"
tags: []
categories: ["编程语言"]
slug: "jre-laf-nimbus"
draft: false
lastmod: "2010-01-26T19:44:16Z"
id: 580411
url: "https://yipsilon.iteye.com/blog/580411"
---

**从6u10开始内置到JRE中了**，可以在UIManager中通过调用 com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel 或 javax.swing.plaf.nimbus.NimbusLookAndFeel 名称打开。

![](http://dl.iteye.com/upload/attachment/198837/9cf2c25f-7dff-31a9-a995-56a89436440b.png)

 

再看看NetBeans的界面吧：

![](http://dl.iteye.com/upload/attachment/198842/1c1038fc-bec2-336d-b215-eb1585fb2c26.png)

感叹，用户体验好了很多，看来Swing越来越有前途啦！

 

P.S. 官方给出了一段这样设置皮肤的代码：

```
import javax.swing.UIManager.*;

try {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            break;
        }
    }
} catch (Exception e) {
    // If Nimbus is not available, you can set the GUI to another look and feel.
}
```