---
title: "Swing 设置windows 风格"
author: "tenderuser"
date: "2011-05-11T21:51:35Z"
tags: []
categories: ["编程语言"]
slug: "swing-windows"
draft: false
lastmod: "2011-05-11T21:51:35Z"
id: 1040679
url: "https://tenderuser.iteye.com/blog/1040679"
---

```java
try {
	UIManager.setLookAndFeel(“com.sun.java.swing.plaf.windows.WindowsLookAndFeel”);//Windows风格
	//UIManager.setLookAndFeel(“com.sun.java.swing.plaf.motif.MotifLookAndFeel”) ; //Mac风格
	//UIManager.setLookAndFeel(“javax.swing.plaf.metal.MetalLookAndFeel”) ;//Java默认风格
} catch (ClassNotFoundException ex) {
	ex.printStackTrace();
} catch (InstantiationException ex) {
	ex.printStackTrace();
} catch (IllegalAccessException ex) {
	ex.printStackTrace();
} catch (UnsupportedLookAndFeelException ex) {
	ex.printStackTrace();
}
```