import java.awt.*;
import java.awt.event.*;
import javax.swing.*;public class PlafTest{
public static void main(String[] args){
PlafFrame ff = new PlafFrame();
ff.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent event){
         System.exit(0);
}
});
ff.setVisible(true);
}
}class PlafFrame extends JFrame{
public PlafFrame(){
setSize(300,200);
PlafPanel pp = new PlafPanel();
Container cc = this.getContentPane();
cc.add(pp);
}
}class PlafPanel extends JPanel{
void makeButton(String s, final String pn){
JButton b = new JButton(s);
add(b);
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
try{
UIManager.setLookAndFeel(pn);
SwingUtilities.updateComponentTreeUI(PlafPanel.this);
}catch(Exception e){
e.printStackTrace();
}
}
});
}
public PlafPanel(){
makeButton("motif", "com.sun.java.swing.plaf.motif.MotifLookAndFeel");
makeButton("metal", "javax.swing.plaf.metal.MetalLookAndFeel");
makeButton("windows", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
}======================================================================请问PlafPanel对象怎样保持makeButton()方法new到的三个Button对象?PlafPanel类没有Button的reference,makeButton()方法的Button reference是局部的变量,makeButton()调回时Button 的reference就没了,makeButton()又没返回Button对象,怎样在PlafPanel对象持有Button对象呢?