主题:帮我看看程序出了什么问题
import javax.swing.JButton;
import javax.swing.JFrame;
import java.awt.GridLayout;
import java.awt.Container;
public class ShowGridLayout extends JFrame{
public ShowGridLayout(){
Container container=getContenPane();
container.setlayout(new GridLayout(4,3,5,5));
for(int i=1;i<=10;i++)
container.add(new JButton("Component"+i));
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ShowGridLayout=frame=new ShowGridLayout();
frame.setTitle("ShowGridLayout");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200,200);
frame.setVisible(true);
}
}
import javax.swing.JFrame;
import java.awt.GridLayout;
import java.awt.Container;
public class ShowGridLayout extends JFrame{
public ShowGridLayout(){
Container container=getContenPane();
container.setlayout(new GridLayout(4,3,5,5));
for(int i=1;i<=10;i++)
container.add(new JButton("Component"+i));
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ShowGridLayout=frame=new ShowGridLayout();
frame.setTitle("ShowGridLayout");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200,200);
frame.setVisible(true);
}
}