下载此文档

java 井字棋.docx


文档分类:IT计算机 | 页数:约10页 举报非法文档有奖
1/10
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/10 下载此文档
文档列表 文档介绍
import .*;
import .*;
import .*;
import ;
// THIS APPLICATION USES JAVA's JFRAME FOR GUI PROGRAMMING
// and implements a connection to a MOUSE via ActionListner
public class TTTGUI extends JFrame implements ActionListener
{
private int NoWin=0, xWon=0, oWon=0;
private int move;

final static String BLANK = " ";
final static String X = "X";
final static String O = "O";
final static int NSimulations = 10000;

private String currentPlayer = X;
private static final long serialVersionUID = 6L; // version 6 unique ID number

protected static ponent NULL = null;
// Graphic constants and graphical units.
private final int NCOL = 3; // button columns
private final int N = 9; // total buttons
private final int WIDTH = 50; // size of buttons
private final int HEIGHT = 35;
private final int GAP = 4; // space between buttons
private final int XSTART = 40;

// display keys & buttons
private String[] keys = {" ", " ", " ",
" ", " ", " ",
" ", " ", " ",
};
private JButton[] button = new JButton[N];
Container pane = getContentPane();
public TTTGUI()
{
setTitle("Tic Tac Toe ");
setSize(WIDTH*5, HEIGHT*6+15);
(null);

setUpGUI();

(
new WindowAdapter() {
public void windowClosing(WindowEvent e)
{

java 井字棋 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数10
  • 收藏数0 收藏
  • 顶次数0
  • 上传人xxj16588
  • 文件大小15 KB
  • 时间2017-12-16