import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.awt.Color;
import javax.swing.JFrame;
import java.awt.Toolkit;
class Test extends JFrame{
//private static final long serialVersionUID = 1L;
public Test(){
int boxs[][]=new int[15][15];
this.setSize(740,735);
this.setVisible(true);
this.setLocation(100, 100);
this.setTitle("纠结的五子棋");
this.setResizable(false);
int screenwidth=Toolkit.getDefaultToolkit().getScreenSize().width;
int screenheight=Toolkit.getDefaultToolkit().getScreenSize().height;
if(this.getWidth()>screenwidth)
this.setSize(screenwidth, this.getHeight());
if(this.getHeight()>screenheight)
this.setSize(this.getWidth(),screenheight);
this.setLocation((screenwidth-this.getWidth())/2,
(screenheight-this.getHeight())/2);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public void paint(Graphics g){
BufferedImage bf=new BufferedImage(740, 735,
BufferedImage.TYPE_INT_RGB);
Graphics g2=bf.createGraphics();
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载