日期:2014-05-18 浏览次数:20643 次
package chess;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Toolkit;
import javax.swing.JFrame;
public class ChessBoard extends JFrame
{
/**
*
*/
private static final long serialVersionUID = 1L;
public ChessBoard()
{
this.setTitle("五子棋");
this.setResizable(false);
this.setSize(600, 600);
int screenX = Toolkit.getDefaultToolkit().getScreenSize().width;
int screenY = Toolkit.getDefaultToolkit().getScreenSize().height;
this.setLocation(screenX/2-300,screenY/2-300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
public static void main(String[] args)
{
new ChessBoard();
}
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;
g2.drawLine(0, 0, 100, 109);
}
}