这个程序错在哪?
import javax.swing.*;public class ImageIcons extends JFrame{
JButton [] buttons= new JButton[10];
public ImageIcons(){
super("imageicons");
setSize(350,200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel pane= new JPanel();
ImageIcon icon= new ImageIcon("face.gif");
for(int i=0;i<10;i++){
buttons[i]= new JButton(icon);
pane.add(buttons[i]);
}
setContentPane(pane);
show();
}
public static void main(String [] args){
ImageIcons inic = new ImageIcons();
}
}
为啥显示不出十个图形,笑脸