java Swing绘制图形界面问题

这些格子感觉都超出了边框的范围,怎么把这些格子全设置在边框之内?图片说明

格子在哪儿呢?swing用的少了,稍稍看看不用深究。

http://blog.csdn.net/zhutulang/article/details/7782097

import java.awt.*;

import javax.swing.*;
public class ChessGrid extends JFrame{
private static final long serialVersionUID = 1L;
private JButton white= new JButton();
private JButton black= new JButton();
public ChessGrid(){
setLayout(new GridLayout(8, 8, 0, 0));
for(int i = 1; i <= 8; i++){
for(int j = 1; j <= 8; j++){
if(i % 2 != 0){
if(j % 2 == 0){
JButton black = new JButton();
black.setBackground(Color.BLACK);
add(black);
}
else{
JButton white= new JButton();
white.setBackground(Color.WHITE);
add(white);
}
}
else{
if(j % 2 != 0){
JButton black = new JButton();
black.setBackground(Color.BLACK);
add(black);
}
else{
JButton white= new JButton();
white.setBackground(Color.WHITE);
add(white);
}
}
}

}
}

public static void main(String[] args){
    ChessGrid frame = new Exercise12_10();
    frame.setTitle("Exercise12_10");
    frame.setSize(400,400);
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
}

}