JAVA“连连看”游戏程序设计

  • r7_994469
    了解作者
  • 83.5KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-16 01:15
    上传日期
JAVA“连连看”游戏程序设计 《Java与对象分布技术》课程设计报告
JAVA“连连看”游戏程序设计.zip
  • JAVA“连连看”游戏程序设计
  • 连连看源代码.txt
    21.7KB
  • 连连看 实验
  • lianliankan$14.class
    546B
  • lianliankan.java
    21.7KB
  • lianliankan$9.class
    544B
  • lianliankan$13.class
    546B
  • lianliankan$6.class
    544B
  • lianliankan$7.class
    544B
  • lianliankan$25.class
    546B
  • lianliankan.class
    11.5KB
  • lianliankan$33.class
    503B
  • lianliankan$21.class
    546B
  • lianliankan$31.class
    547B
  • lianliankan$15.class
    546B
  • lianliankan$22.class
    546B
  • lianliankan$24.class
    546B
  • lianliankan$29.class
    547B
  • lianliankan$4.class
    544B
  • lianliankan$10.class
    545B
  • lianliankan$1.class
    474B
  • lianliankan$17.class
    546B
  • lianliankan$2.class
    480B
  • lianliankan$12.class
    546B
  • lianliankan$8.class
    544B
  • lianliankan$3.class
    544B
  • lianliankan$28.class
    547B
  • lianliankan$27.class
    546B
  • lianliankan$16.class
    546B
  • lianliankan$32.class
    547B
  • lianliankan$26.class
    546B
  • lianliankan$11.class
    545B
  • lianliankan$18.class
    546B
  • lianliankan$23.class
    546B
  • lianliankan$5.class
    544B
  • lianliankan$20.class
    546B
  • lianliankan$30.class
    547B
  • lianliankan$19.class
    546B
  • java课程设计.doc
    130KB
内容介绍
import java.awt.*; import java.awt.event.*; public class lianliankan implements ActionListener { static String s="no"; //用来纪录点击按钮的信息 int x0=0,y0=0,x=0,y=0,n1=0,n2=0; //用来纪录按钮的位置信息 Frame f,f1; Button b1,b2,b3,b4,b5,b6,b7,b8,b9,b10; //添加30个按钮 Button b11,b12,b13,b14,b15,b16,b17,b18; // 来实现游戏界面 Button b19,b20,b21,b22,b23,b24,b25; //可以用数组实现 Button b26,b27,b28,b29,b30,bc; Button p1,p2,br,bt1,bt2; //p1、p2为选定的按钮 Panel panel1,panel2; int d[][]={ //用来和界面的按钮建立映射关系 {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} }; public static void main(String[] args) { lianliankan t=new lianliankan(); t.suiji(); t.go(); } public void actionPerformed(ActionEvent e) //再来一次按钮的响应事件。 { int d[][]={ {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} }; this.d=d; suiji(); //调用随机函数,产生随机数; f.setVisible(false); f1.setVisible(false); s="no"; go(); } /////////////////////////////////////初始化界面 public void go() { f=new Frame("连连看!FOX"); panel2=new Panel(); panel1=new Panel(); bc=new Button(" EXIT"); br=new Button("RESET"); p1=new Button(); b1=new Button(String.valueOf(d[1][1])); b2=new Button(String.valueOf(d[1][2])); b3=new Button(String.valueOf(d[1][3])); b4=new Button(String.valueOf(d[1][4])); b5=new Button(String.valueOf(d[1][5])); b6=new Button(String.valueOf(d[2][1])); b7=new Button(String.valueOf(d[2][2])); b8=new Button(String.valueOf(d[2][3])); b9=new Button(String.valueOf(d[2][4])); b10=new Button(String.valueOf(d[2][5])); b11=new Button(String.valueOf(d[3][1])); b12=new Button(String.valueOf(d[3][2])); b13=new Button(String.valueOf(d[3][3])); b14=new Button(String.valueOf(d[3][4])); b15=new Button(String.valueOf(d[3][5])); b16=new Button(String.valueOf(d[4][1])); b17=new Button(String.valueOf(d[4][2])); b18=new Button(String.valueOf(d[4][3])); b19=new Button(String.valueOf(d[4][4])); b20=new Button(String.valueOf(d[4][5])); b21=new Button(String.valueOf(d[5][1])); b22=new Button(String.valueOf(d[5][2])); b23=new Button(String.valueOf(d[5][3])); b24=new Button(String.valueOf(d[5][4])); b25=new Button(String.valueOf(d[5][5])); b26=new Button(String.valueOf(d[6][1])); b27=new Button(String.valueOf(d[6][2])); b28=new Button(String.valueOf(d[6][3])); b29=new Button(String.valueOf(d[6][4])); b30=new Button(String.valueOf(d[6][5])); panel1.setSize(500,600); panel2.setSize(100,40); panel1.setLayout(new GridLayout(6,5)); //panel1上面放置6行5列按钮 panel1.setBackground(Color.black); panel1.setLocation(50,100); panel2.setLocation(0,200); bc.setLocation(0,40); br.setLocation(0,100); panel1.setFont(new Font("宋体",64,35)); panel2.setFont(new Font("宋体",44,30)); f.add(panel1); f.add(panel2); panel2.add(bc); panel2.add(br); panel1.add(b1); panel1.add(b2); panel1.add(b3); panel1.add(b4); panel1.add(b5); panel1.add(b6); panel1.add(b7); panel1.add(b8); panel1.add(b9); panel1.add(b10); panel1.add(b11); panel1.add(b12); panel1.add(b13); panel1.add(b14); panel1.add(b15); panel1.add(b16); panel1.add(b17); panel1.add(b18); panel1.add(b19); panel1.add(b20); panel1.add(b21); panel1.add(b22); panel1.add(b23); panel1.add(b24); panel1.add(b25); panel1.add(b26); panel1.add(b27); panel1.add(b28); panel1.add(b29); panel1.add(b30); f.pack(); f.setBounds(25,10,600,750); f.setResizable(false); f.setVisible(true); bc.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { ex(); } }); br.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { chonglie(); } }); b1.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e){ wei(1,1,b1); } }); b2.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(1,2,b2); } }); b3.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(1,3,b3); } }); b4.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(1,4,b4); } }); b5.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(1,5,b5); } }); b6.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e){ wei(2,1,b6); } }); b7.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(2,2,b7); } }); b8.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(2,3,b8); } }); b9.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(2,4,b9); } }); b10.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e){ wei(2,5,b10); } }); b11.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(3,1,b11); } }); b12.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(3,2,b12); } }); b13.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(3,3,b13); } }); b14.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(3,4,b14); } }); b15.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(3,5,b15); } }); b16.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(4,1,b16); } }); b17.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(4,2,b17); } }); b18.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(4,3,b18); } }); b19.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(4,4,b19); } }); b20.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(4,5,b20); } }); b21.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e){ wei(5,1,b21); } }); b22.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(5,2,b22); } }); b23.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(5,3,b23); } }); b24.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e){ wei(5,4,b24); } }); b25.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(5,5,b25); } }); b26.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(6,1,b26); } }); b27.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(6,2,b27); } }); b28.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(6,3,b28); } }); b29.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(6,4,b29); } }); b30.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { wei(6,5,b30); } }); } ////////////////////////退出游戏界面 public void ex() { f1=new Frame("EXIT THIS GAME!"); f1.setLayout(new Gr
评论
    相关推荐
    • java贪吃蛇游戏程序设计
      该程序为贪吃蛇游戏程序,是针对贪吃蛇小游戏的JAVA程序,利用方向键来改变蛇的运行方向,空格键暂停或继续游戏,并在随机的地方产生食物,吃到食物就变成新的蛇体,并且是用红蓝间隔画蛇身,碰到壁或自身则游戏结束...
    • java猜拳游戏程序
      int count = 0; Scanner input = new Scanner(System.in); User person = new User(); Computer computer =new Computer(); public void chuShiHua(){
    • java拼图游戏程序
      java拼图游戏的实例,源码,不错
    • java程序游戏
      FlyingBrid小游戏FlyingBrid小游戏FlyingBrid小游戏FlyingBrid小游戏
    • 扫雷游戏程序(java)
      游戏Java编写的,完全可以当作你的业余爱好,而且玩此游戏可以开拓你的思维,还等什么,赶紧加入
    • Java连连看游戏程序源码
      Java语言编写,有详细注释,用到了gui JavaJavaJavaJavaJavaJavaJavaJavaJavaJavaJavaJavaJavaJavaJava
    • java编写网络五子棋游戏程序
      Java开发典型模块大全》一书中的源代码。 经典代码! 非常值得借鉴和学习!
    • Java编写的五子棋游戏程序
      Java编写的五子棋游戏,主要是适合学生学习借鉴的,呵呵
    • 豪斯游戏 java程序
      该程序是由java编写的游戏程序,采用良好的界面
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档