在frame中添加:
UIManager.addPropertyChangeListener(new UISwitchListener( (JComponent)getRootPane()));UISwitchListener.java
========================================================================
import java.beans.*;
import javax.swing.*;/**
 * This class listens for UISwitches, and updates a given component.
 *
 * @version 1.8 01/23/03
 * @author Steve Wilson
 */
public class UISwitchListener
    implements PropertyChangeListener {
  JComponent componentToSwitch;  public UISwitchListener(JComponent c) {
    componentToSwitch = c;
  }  public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if (name.equals("lookAndFeel")) {
      SwingUtilities.updateComponentTreeUI(componentToSwitch);
      componentToSwitch.invalidate();
      componentToSwitch.validate();
      componentToSwitch.repaint();
    }
  }
}
========================================================================具体可以参考jdk的demo\jfc\Metalworks\src