设为首页 加入收藏

TOP

Java写的华容道
2014-10-29 22:30:09 】 浏览:298
Tags:Java 华容道

  import java.awt.*;


  import java.awt.event.*;


  import javax.swing.*;


  public class Hua_Rong_Road {


  /**


  * @param args


  */


  public static void main(String[] args) {


  // TODO 自动生成方法存根


  new Hua_Rong_Road1();


  }


  }


  class Person extends JButton implements FocusListener


  {


  int number;


  ImageIcon c;


  Person(int number,ImageIcon c)


  {


  super(c);


  this.c=c;


  this.number=number;


  addFocusListener(this);


  }


  public void focusGained(FocusEvent e)


  {


  setBackground(Color.red);


  }


  public void focusLost(FocusEvent e)


  {


  }


  }


  class Hua_Rong_Road1 extends Frame implements MouseListener,KeyListener,ActionListener


  {


  Person person[]=new Person[10];


  Button left,right,above,below;


  Button restart=new Button("重新开始");


  public Hua_Rong_Road1()


  {


  init();


  setBounds(100,100,320,380);


  setResizable(false);


  setVisible(true);


  validate();


  addWindowListener(new WindowAdapter()


  {


  public void windowClosing(WindowEvent e)


  {


  System.exit(0);


  }


  }


  );


  }


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇了解Java日志系统框架的设计与实现 下一篇J2EE系统开发捷径给初学者的一些..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目