import javax.swing.*;
import java.awt.*;
public class Test22{

public static void main(String[] args)
{ Gridframe frame1=new Gridframe();
          for(int i=1;i<=36;i++)
{
    frame1.add(new JButton("button"+i));
}
frame1.setSize(200,200);
frame1.setLocation(500,0);
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame1.setVisible(true);

      
}
}class Gridframe extends JFrame{
 Gridframe()
{
setLayout(new GridLayout(10,6,5,5));
}

Gridframe(String title)
{
super(title);
setLayout(new GridLayout(10,6,20,30));
}
}比如上面的代码,我要输出36个按钮,gridlayout输出应为10行6列的,为什么实际输出是10行9列?
搞不懂gridlayout是怎么输出的```请高手赐教```