91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 113KB
    文件類(lèi)型: .rar
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-06-23
  • 語(yǔ)言: Java
  • 標(biāo)簽: 斗獸棋??java??

資源簡(jiǎn)介

一個(gè)簡(jiǎn)單的斗獸棋游戲,在java上做的,希望大家喜歡。

資源截圖

代碼片段和文件信息

package?mypackage;

import?java.awt.*;
import?java.awt.event.*;

import?javax.swing.*;

import?java.util.*;
import?java.io.*;

public?class?Myfirstp?{


public?static?void?main(String[]?args)?{

new?Mychess(“棋類(lèi)游戲“);

}

}


class?Mychess?extends?Jframe?implements?ActionListenerMouseListenerRunnable
{

JLabel?play[]?=?new?JLabel[16];

Container?con;

JToolBar?jmain;

JLabel image;

JButton?anew;
//悔棋
JButton?repent;
//打開(kāi)
JButton?showOpen;
//保存
JButton?showSave;
//退出
JButton?exit;

//當(dāng)前信息
JLabel?text;

//保存當(dāng)前操作
Vector?FileVar;
Vector?Var;

//規(guī)則類(lèi)對(duì)象(使于調(diào)用方法)
ChessRule?rule;

/*單擊棋子**********************************/
/*chessManClick?=?true?閃爍棋子?并給線(xiàn)程響應(yīng)*/
/*chessManClick?=?false?吃棋子?停止閃爍??并給線(xiàn)程響應(yīng)*/
boolean?chessManClick;

/*控制玩家走棋****************************/
/*chessPlayClick=1?黑棋走棋*/
/*chessPlayClick=2?紅棋走棋?默認(rèn)紅棋*/
/*chessPlayClick=3?雙方都不能走棋*/
int?chessPlayClick=2;

//控制棋子閃爍的線(xiàn)程
Thread?tmain;
//把第一次的單擊棋子給線(xiàn)程響應(yīng)
static?int?Mani;

Mychess(String?title)
{
con?=?this.getContentPane();
con.setLayout(null);

//實(shí)例化規(guī)則類(lèi)
rule?=?new?ChessRule();
FileVar??=?new?Vector();
Var?=?new?Vector();

jmain?=?new?JToolBar();
text?=?new?JLabel(“紅棋走棋“);
text.setToolTipText(“提示信息“);
anew?=?new?JButton(“新游戲“ );
anew.setToolTipText(“重新開(kāi)始新的一局“);
exit?=?new?JButton(“退??出“);
exit.setToolTipText(“退出本程序“);
repent?=?new?JButton(“?悔??棋?“);
repent.setToolTipText(“返回到上次走棋的位置“);
showOpen?=?new?JButton(“打開(kāi)“);
showOpen.setToolTipText(“打開(kāi)以前棋局“);
showSave?=?new?JButton(“保存“);
showSave.setToolTipText(“保存當(dāng)前棋局“);

jmain.setLayout(new?GridLayout(06));
jmain.add(anew);
jmain.add(repent);
jmain.add(showOpen);
jmain.add(showSave);
jmain.add(exit);
jmain.add(text);
jmain.setBounds(045036030);
con.add(jmain);

//添加棋子標(biāo)簽
drawChessMan();

/*注冊(cè)監(jiān)聽(tīng)者*/

//注冊(cè)按扭監(jiān)聽(tīng)
anew.addActionListener(this);
repent.addActionListener(this);
exit.addActionListener(this);
showOpen.addActionListener(this);
showSave.addActionListener(this);

//注冊(cè)棋子移動(dòng)監(jiān)聽(tīng)
for?(int?i=0;i<16;i++)
{
con.add(play[i]);
play[i].addMouseListener(this);
}

con.add(image?=?new?JLabel(new?ImageIcon(“chess.gif“)));
image.setBounds(00360450);
image.addMouseListener(this);

this.addWindowListener(new?WindowAdapter()?
{
public?void?windowClosing(WindowEvent?we)
{
System.exit(0);
}
});

Dimension?screenSize?=?Toolkit.getDefaultToolkit().getScreenSize();
Dimension?frameSize?=?this.getSize();

if?(frameSize.height?>?screenSize.height)
{
frameSize.height?=?screenSize.height;
}
if?(frameSize.width?>?screenSize.width)
{
frameSize.width?=?screenSize.width;
}


this.setLocation((screenSize.width?-?frameSize.width)?/?2?-?200?(screenSize.height?-?frameSize.height?)?/?2?-?290);

this.setI

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----

?????文件???????1735??2009-08-26?12:52??java\cat1.gif

?????文件???????1739??2009-08-26?12:57??java\cat2.gif

?????文件??????59165??2009-08-26?15:36??java\chess.gif

?????文件???????1670??2009-08-26?12:58??java\dog1.gif

?????文件???????1666??2009-08-26?12:58??java\dog2.gif

?????文件???????1784??2009-08-26?12:53??java\elephant1.gif

?????文件???????1777??2009-08-26?12:58??java\elephant2.gif

?????文件???????1726??2009-08-26?12:50??java\leopard1.gif

?????文件???????1726??2009-08-26?12:59??java\leopard2.gif

?????文件???????1975??2009-08-26?12:47??java\lion1.gif

?????文件???????1969??2009-08-26?12:57??java\lion2.gif

?????文件???????1585??2009-08-26?12:49??java\mouse1.gif

?????文件???????1584??2009-08-26?12:59??java\mouse2.gif

?????文件??????32858??2009-08-30?14:13??java\Myfirstp.java

?????文件???????1772??2009-08-26?12:52??java\tiger1.gif

?????文件???????1773??2009-08-26?12:59??java\tiger2.gif

?????文件???????1547??2009-08-26?12:51??java\wolf1.gif

?????文件???????1539??2009-08-26?13:00??java\wolf2.gif

????..A.SH.?????39424??2009-11-02?19:59??java\Thumbs.db

?????目錄??????????0??2009-10-26?17:03??java

-----------?---------??----------?-----??----

???????????????159014????????????????????20


評(píng)論

共有 條評(píng)論