菜鸟求助,围棋界面颜色如何更改,谢谢
import java.awt.*;
class TestGridLayout extends Frame{
public static void main(String[] args){
TestGridLayout tgl=new TestGridLayout();
tgl.setTitle("围棋界面");
tgl.setSize(300,300);
GridLayout grid=new GridLayout(9,9);
grid.setHgap(0);
grid.setVgap(0);
tgl.setLayout(grid);
for(int i=0;i<=80;i++){
tgl.add(new Button());
}
tgl.setVisible(true);
}
}我想把围棋棋盘的颜色设为黄色,请问怎么修改程序,谢谢
------解决方案--------------------Java code
for(int i=0;i<=80;i++){
Button btn = new Button();
tgl.add(btn);
Color c = new Color(255,255,0);
btn.setBackground(c);
}