import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
 class E10_1 extends Frame implements ActionListener{

JButton b1,b2,b3;
public E10_1(){
super("龙少");
setLayout(new FlowLayout());
setSize(200,200);
setVisible(true);
b1=new JButton("Mac");b2=new JButton("Metal");b3=new JButton("Windows");
  b1.addActionListener(this);b2.addActionListener(this);b3.addActionListener(this);
  add(b1);add(b2);add(b3);
  addWindowListener(new WindowAdapter (){public void windowClosing(WindowEvent e){setVisible(true);System.exit(0);}});
}
public void actionPerformed(ActionEvent e){
String lnfName=null;
if(e.getActionCommand().equals("Mac"))
{  lnfName="com.apple.mrj.swing.MacLookAndFeel";}
else if(e.getActionCommand().equals("Metal"))
{  lnfName="javax.swing.plaf.metal.MetalLookAndFeel";}
else if(e.getActionCommand().equals("Windows"))
{  lnfName="com.sun.java.swing.plaf.motif.MotifLookAndFeel";}

try{
UIManager.setLookAndFeel(lnfName);
SwingUtilities.updateComponentTreeUI(this);}
catch(UnsupportedLookAndFeelException ex1){System.err.println("Unsupported LookAndFeel:"+lnfName);}
catch(ClassNotFoundException ex2){System.err.println("class not found:"+lnfName);}
catch(InstantiationException ex3){System.err.println("Could not load LookAndFeel:"+lnfName);}
catch(IllegalAccessException ex4){System.err.println("Cannot use LookAndFeel:"+lnfName);}
}
}
public class E10{
public static void main(String args[]){
E10_1 f=new E10_1();f.pack();
}
}
UnsupportedLookAndFeelException   貌似这句有错误,我在UEd 上没显示红的,
这个程序其他的风格都对了,但就是第一个  mac  点这个按钮报错:class not found com.apple.mrj.swing.MacLookAndFeel
麻烦高手看下,谢了。