import java.awt.*;
import java.awt.event.*;
public class ChessBoard extends Frame
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
*
*/
public static void main(String[]args){new ChessBoard();}
@SuppressWarnings("deprecation")
ChessBoard()
{
super("ChessBoard");
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e){System.exit(0);}});
setSize(408,434);
add("Center",new CvChessBoard());
show();
}
}
class CvChessBoard extends Canvas
{
public void paint(Graphics g)
{
Dimension d=getSize();
int w=50;
for(int j=0;j<8;++j)
for(int i=0;i<8;i++)
{
g.setColor((j+8-i)%2 == 0 ?
Color.lightGray:Color.darkGray);
g.fillRect(j*w,i*w,w,w);
}
}
}