资源简介
java开发的连连看小游戏,框架完整,适合初学者学习!

代码片段和文件信息
package kyodai;
import java.awt.*;
import javax.swing.*;
/**
* title: LianLianKan
* Description: 连连看
* Copyright: Copyright (c) 2004
* Company: www.wuhantech.com
* @author ZhangJian
* @version 1.0
*/
public class ClockAnimate
extends JPanel
implements Runnable {
private volatile Thread thread;
long startTime = 0l; //开始时间
long usedTime = 0l; //使用时间
Color color = new Color(212 255 200);
//Color jfcBlue = new Color(255 255 0);
//Color jfcBlue = new Color(55 77 118);
Font font48 = new Font(“serif“ Font.PLAIN 28);
java.text.DecimalFormat df = new java.text.DecimalFormat(“000“);
java.text.DecimalFormat df2 = new java.text.DecimalFormat(“0“);
public ClockAnimate() {
this.setMinimumSize(new Dimension(156 48));
this.setPreferredSize(new Dimension(156 48));
}
/**
* 绘制时间
* @param g
*/
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
Dimension d = getSize();
g2.setBackground(new Color(111 146 212));
g2.clearRect(0 0 d.width d.height);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING
RenderingHints.VALUE_ANTIALIAS_ON);
g2.setColor(color);
g2.setFont(font48);
g2.drawString(“Time:“ + getTime() 16 40);
}
/**
* 取得使用时间格式化后的字符串
* @param time
* @return
*/
String getTime() {
int sec ms;
long time;
time = usedTime;
sec = Math.round(time / 1000);
time -= sec * 1000;
ms = Math.round(time / 100);
return (df.format(sec) + “.“ + df2.format(ms));
}
public void start() {
startTime = System.currentTimeMillis();
thread = new Thread(this);
thread.start();
}
public void run() {
Thread currentThread = Thread.currentThread();
while (thread == currentThread) {
long time = System.currentTimeMillis();
usedTime = time - startTime;
try {
repaint();
thread.sleep(100l);
}
catch (InterruptedException ex) {
}
}
}
public void stop() {
if (thread != null) {
thread = null;
}
}
/**
* 取得用户使用的时间
* @return
*/
public int getUsedTime() {
return Math.round(usedTime / 1000);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2004-12-24 09:59 doc\
文件 685 2004-11-23 21:27 doc\about.htm
文件 2272 2004-11-24 17:52 doc\help.htm
文件 1265 2004-11-24 00:39 doc\setup.htm
目录 0 2004-12-24 09:59 images\
文件 1302 2004-11-15 09:34 images\1.gif
文件 1636 2004-11-15 09:53 images\10.gif
文件 1634 2004-11-15 09:55 images\11.gif
文件 1517 2004-11-15 09:43 images\12.gif
文件 1581 2004-11-15 09:55 images\13.gif
文件 1550 2004-11-15 09:57 images\14.gif
文件 1572 2004-11-15 09:57 images\15.gif
文件 1573 2004-11-15 09:36 images\16.gif
文件 1507 2004-11-15 09:58 images\17.gif
文件 1416 2004-11-15 09:58 images\18.gif
文件 1668 2004-11-15 09:58 images\19.gif
文件 1681 2004-11-15 09:47 images\2.gif
文件 1568 2004-11-15 09:59 images\20.gif
文件 1647 2004-11-15 09:59 images\21.gif
文件 1626 2004-11-15 09:44 images\22.gif
文件 1654 2004-11-15 09:59 images\23.gif
文件 1634 2004-11-15 10:00 images\24.gif
文件 1490 2004-11-15 10:00 images\25.gif
文件 1587 2004-11-15 10:01 images\26.gif
文件 1663 2004-11-15 09:36 images\27.gif
文件 1570 2004-11-15 10:02 images\28.gif
文件 1576 2004-11-15 09:37 images\29.gif
文件 1652 2004-11-15 09:47 images\3.gif
文件 1647 2004-11-15 09:37 images\30.gif
文件 1587 2004-11-15 09:38 images\31.gif
文件 1632 2004-11-15 09:42 images\32.gif
............此处省略52个文件信息
- 上一篇:content.jar
- 下一篇:mybatis-spring-1.3.0.jar
相关资源
- 个人根据Android移动开发案例详解手写
- Android手机连连看游戏源码
- JAVA 连连看游戏
- JAVA连连看包括源码。图片等
- qq游戏连连看java秒杀外挂源码
- Android游戏源码五合一连连看小游戏源
- java连连看课程设计说明书含源码
- 连连看android小游戏源码
- android连连看游戏实现
- JAVA写的连连看
- android连连看源码
- Android小游戏连连看源码
- 基于JAVA的连连看游戏设计.rar
- Java编写的图形化连连看
- android水果连连看源码
- 安卓Android手机安卓连连看游戏毕业设
- Java课程设计连连看游戏(含代码)
- 连连看图形界面美观
- Android水果连连看游戏源码
- Android毕业设计-连连看游戏
- 连连看小游戏(简洁版)
- Android 连连看游戏(游戏开发-17_167)
- android 版本的疯狂连连看源代码
- java连连看源代码
- JavaFx版连连看及
- 初学JAVA,用JAVA编写一个简单的连连看
- 连连看javafx
- JAVA 课程设计源码 连连看 SWING 完整代
- JAVA-连连看
- Java版连连看游戏完整源码+素材
评论
共有 条评论