- 138
- 0
- 约7.76千字
- 约 10页
- 2018-09-17 发布于湖北
- 举报
JAVA写的围棋游戏的源代码
JavaD′μ??§??ó??·μ??′′ú??.txt?òμ?è?éúóDA ??ò2óDB??£???μ?è?éúóDS??ò2óDB???£ ê§°ü2??é??£?1??ü?′ê?2?ê?3é1|???è?£???úμ?′ó?§éúì??????êá?£?1yà′??????£??óè?ó????D£?óD???§·???襣??àoó????o??1ò2????21á?éú?°?ò2??eo?·?μ?ò?o??£import java.awt.*;
import java.awt.event.*;
import javax.swing.JOptionPane;
public class Chess extends Frame
{
ChessPad chesspad= new ChessPad();
Chess()
{
add(chesspad);
chesspad.setBounds(70,90,440,440);
Label label=new Label(click to point,doubled_click to remove,right click to back,Label.CENTER);
add(label);
label.setBounds(70,55,440,24);
label.setBackground(Color.orange);
addWindowListener
(
new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
);
setLayout(null);
setVisible(true);
setSize(600,550);
}
public static void main(String args[])
{
Chess chess=new Chess();
}
}
class ChessPad extends Panel implements MouseListener, ActionListener,FocusListener
{
int x = -1, y = -1, chessColor = 1;
String blackname=,whitename=;
Button button=new Button(start);
Button inputButton=new Button(input);
TextField text_1=new TextField(black please),
text_2=new TextField(),//white please
text_3=new TextField(blackname),
text_4=new TextField(whitename);
ChessPad()
{
add(inputButton);
inputButton.setBounds(35,5,60,26);
inputButton.addActionListener(this);
inputButton.addFocusListener(this);
add(text_3);
text_3.setBounds(115,5,90,24);
text_3.addFocusListener(this);
text_3.setEditable(true);
add(text_4);
text_4.setBounds(315,5,90,24);
text_4.addFocusListener(this);
text_4.setEditable(true);
add(button);
button.setBounds(35,36,60,26);
button.setEnabled(false);
button.addActionListener(this);
add(text_1);
text_1.setBounds(115,36,90,24);
text_1.setEnabled(false);
text_1.setEditable(false);
add(text_2);
text_2.setBounds(315,36,90,24);
text_2.setEnabled(false);
text_2.setEditable(false)
您可能关注的文档
- EDA数字密码锁的设计.doc.doc
- eda设计书正文数字密码锁设计.doc.doc
- Early Release Schemes in Hong Kong - Association of Paroling 早期的版本计划在香港协会假释.ppt
- eetop.cn_【ISE TCAD】Diode process and simulation.ppt
- EMAIL服务器的配置.doc
- EAM设备管理解决方案(最新)资料.ppt
- EMBA帝王之道:明朝开国皇帝— 朱元璋.ppt
- Enfosoft-宝鸡文理学院-英福金银花ETM研究生教育管理信息系统产品配置解决方案20140108.doc
- ENGINEERING ETHICS - WORKPLACE EXPERIENCE:工程伦理的工作经验.ppt
- EPLAN报表[管理资料].doc
最近下载
- 年产2万吨碳酸锂项目(吸附剂车间竣工环保验收监测调查报告.docx VIP
- 2025年高考湖南卷物理真题试卷.pdf VIP
- 生物安全培训.doc VIP
- 圣兴化工年产1万吨硝酸镁、2万吨水溶肥、1万吨硝酸钙、2万吨太阳能熔盐、5万吨农业(工业)硝酸钾及5.4万吨氯化镁溶液项目环评.doc VIP
- DB37T 4983—2025 无人机半航空瞬变电磁探测技术规程.pdf
- 2026春沪教版七年级英语下册单词衡水体字帖.pdf VIP
- 25HNTJ026 锯齿形装配式混凝土剪力墙结构施工图制图规则及构造详图 T_HNKCSJ 025-2025.docx VIP
- 25HNTJ025 刚节点装配式混凝土框架结构施工图制图规则及构造详图 T_HNKCSJ 024-2025.docx VIP
- 25HNTJ025 低能耗集成装配式多层房屋构造 T_HNKCSJ 023-2025.docx VIP
- 催眠引导语合集元式催眠.docx VIP
原创力文档

文档评论(0)