我真的搞不懂这个代码有什么错啊
下面的代码有三个错误啊,高手们帮我看看啊
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MyGridLayout
{
public MyGridLayout()
{
JFrame f=new JFrame();
Container contentPane=f.getContentPane();
contentPane.setLayout(new GridLayout(10,10));
for(int i=1;i<=9;i++)
contentPane.add(new JButton(""+i));
f.setTitle("网格");
f.pack();
f.setVisible(true);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
public static void main(String args[]){
GridLayoutDemo b=new MyGridLayoutDemo();
}
}