记忆测试系统-JAVA实现
Java的心得体会报告(优秀10篇)

Java的心得体会报告(优秀10篇)Java的心得体会报告篇1此次只实训了短短的三周。
虽说时间很短,但其中的每一天都使我收获很大、受益匪浅,它不但极大地加深了我对一些理论知识的理解,不仅使我在理论上对Java有了全新的认识,在实践能力上也得到了提高,真正地做到了学以致用,更学到了很多做人的道理,对我来说受益非浅。
除此以外,我知道了什么叫团队,怎样和团队分工合作;同时我还学会了如何更好地与别人沟通,如何更好地去陈述自己的观点,如何说服别人认同自己的观点。
这也是第一次让我亲身感受到理论与实际的相结合,让我大开眼界。
也是对以前所学知识的一个初审吧!这次实训对于我以后学习、找工作也是受益菲浅的,在短短的三周中相信这些宝贵的经验会成为我今后成功的重要的基石;这对于我的学业,乃至我以后人生的影响无疑是极其深远的。
这次实训虽然是我们的第一次,不过同学们表现不错,由此看来,我们在进入大学的这几个月里学到了不少的专业知识,只是自己感觉不到而已。
对于所学专业,我们不能过于自卑和担忧,否则会妨碍自己学习。
实训是学习Java的重要环节,有利于我们巩固专业知识、掌握工作技能,提高就业筹码。
我把本次为期三周的实训看作是“理论与实践相结合的桥梁”。
通过这周的实训和学习,我知道了此次实训的目的,也清楚目前自己的不足,那就是缺乏相应的知识与经验,对所学的专业知识不能够很好地运用于实践操作。
正所谓“百闻不如一见”,经过这次自身的切身实践,我才深切地理会到了“走出课堂,投身实践”的必要性。
平时,我们只能在课堂上与老师一起纸上谈兵,思维的认识基本上只是局限于课本的范围之内,也许就是这个原因就导致我们对专业知识认识的片面性,使得我们只知所以然,而不知其之所以然!限制了我们网络知识水平的提高。
但是课本上所学到的理论知识是为我们的实际操作指明了方向、提供相应的方法,真正的职业技巧是要我们从以后的实际工作中慢慢汲取的。
而针对实际操作中遇到的一些特殊的问题,我们不能拘泥于课本,不可纯粹地“以本为本”。
基于微信小程序的考研智能刷题系统的设计与实现

Science and Technology &Innovation ┃科技与创新2021年第14期·143·文章编号:2095-6835(2021)14-0143-02基于微信小程序的考研智能刷题系统的设计与实现季波,杨艳婷,李司航,朱开心,刘海涛(南京工业大学浦江学院,江苏南京211200)摘要:在对现有在线试题库练习平台的优缺点进行研究分析的基础上,对考研智能刷题系统功能进行设计。
基于微信小程序技术,通过知识点练习,掌握学生知识的盲点,在不同阶段推荐不同的知识点试题,以便使考生考试前一天的记忆效果达到最佳。
系统主要功能包括知识点练习、知识点视频、真题模考、番茄计时等。
系统采用微信小程序框架、Servlet 技术、MYSQL 数据库等主流的开发工具,技术界面简洁友好,性能良好。
关键词:在线学习;智能刷题;知识点;Servlet 中图分类号:TP311文献标志码:A DOI :10.15913/ki.kjycx.2021.14.0571概述近些年来,国内兴起了如猿题库、智学网、松鼠AI 等一些在线试题库练习平台。
利用刷题系统进行碎片化学习的研究非常多。
2012年,高祥翀发表了《基于碎片化学习的远程开放教育移动学习模式探讨》,该篇文章提出采用碎片化学习方式能达到非常好的学习效果,移动学习必将成为未来学习过程中不可或缺的学习方式[1]。
2015年,王承博等深刻研究了在大数据时代下如何进行碎片化学习,并发表了《大数据时代碎片化学习研究》,该文章提出大数据时代从知识碎片化到知识体系嬗变过程的有关理论[2]。
2016年,王竹立等将“互联网+”课堂模式带入碎片化学习的研究当中,并发表了《移动互联时代的碎片化学习及应对之策—从零存整取到“互联网+”课堂》,该文章提出未来个人导向的系统学习将取代学科导向的系统学习,成为主流的学习模式[3]。
2018年,王家辉等针对各类做题软件中做题模式单一导致学生复习效率低下的问题,发表了《基于知识图谱的微信智能刷题系统》,该篇利用了推荐系统、协同过滤等方式,构建学生知识图谱,有效地提升了学生的复习效率[4]。
学校管理系统实验报告(3篇)

第1篇一、实验目的本次实验旨在通过设计和实现一个学校管理系统,提高学校管理工作的效率和质量。
通过本实验,学生能够掌握数据库的基本操作、编程语言的使用以及系统设计的流程,从而培养学生的实际操作能力和综合应用能力。
二、实验内容1. 需求分析- 确定系统功能:包括学生信息管理、教师信息管理、课程信息管理、成绩管理、教务管理等。
- 确定系统用户:包括学生、教师、教务管理员等。
2. 系统设计- 数据库设计:设计学生表、教师表、课程表、成绩表等。
- 界面设计:设计用户登录界面、学生信息管理界面、教师信息管理界面等。
3. 系统实现- 数据库实现:使用MySQL数据库创建数据库和表。
- 编程实现:使用Java或Python等编程语言编写系统代码。
- 界面实现:使用Swing或Tkinter等图形界面库设计用户界面。
4. 系统测试- 功能测试:测试各个功能的正确性和稳定性。
- 性能测试:测试系统在高并发情况下的性能表现。
- 安全测试:测试系统的安全性,防止非法用户访问。
三、实验步骤1. 需求分析阶段- 通过查阅相关资料,了解学校管理的基本流程和需求。
- 与学校管理人员沟通,确定系统需要实现的功能。
2. 系统设计阶段- 使用E-R图或数据库设计工具设计数据库结构。
- 设计系统界面原型,确定用户界面布局。
3. 系统实现阶段- 使用数据库设计工具创建数据库和表。
- 使用编程语言编写系统代码,实现各个功能模块。
- 使用图形界面库设计用户界面。
4. 系统测试阶段- 编写测试用例,对系统进行功能测试、性能测试和安全测试。
- 根据测试结果,对系统进行修改和完善。
四、实验结果1. 系统功能实现- 学生信息管理:包括学生信息的增删改查、成绩查询、班级管理等。
- 教师信息管理:包括教师信息的增删改查、课程安排等。
- 课程信息管理:包括课程信息的增删改查、选课管理等。
- 成绩管理:包括成绩的录入、查询、统计等。
- 教务管理:包括教务工作的安排、通知发布等。
基于艾宾浩斯记忆曲线的单词记忆系统的设计与实现毕业论文

毕业设计中文题目基于艾宾浩斯记忆曲线的单词记忆系统的设计与实现英文题目Design and Implementation ofthe Word-Memory System Based onEbbinghaus Curve摘要摘要当前英语地位日趋重要,词汇量成为制约大部分人英语能力的障碍。
为帮助人们更加轻松、高效的完成单词记忆过程,本次项目将结合心理学原理设计开发一个基于B/S架构的单词记忆系统。
系统主要实现记忆单词的基本功能,如:基于艾宾浩斯记忆曲线的任务进程初始化、进程参数动态更新、记忆曲线每日修正、任务列表动态初始化、动态调整任务推送次序等核心功能。
与其他同类系统不同的是,该系统采用了心理学的研究成果,更符合人类的记忆活动,并能够根据用户的操作不断地更新用户的记忆曲线使之更符合用户个性化的记忆能力。
系统采用java编程,核心技术涉及:数据库编程、Strut2框架、轻量级数据交换格式JSON、ExtJS的Ajax数据代理模式及界面显示技术。
关键词:艾宾浩斯;单词记忆系统;记忆曲线更新ABSTRACTABSTRACTEnglish has being become more and more important, Limited vocabulary is a barrier to so many people. To help people remember words comfortable and more efficient. This project applied the psychological principles, design and implementation of system base-on B/S architecture. The system achieve basic function of remember words.The core business includes the following functions. Initialize a user forgetting curve base-on Ebbinghaus Curve.C urve’s parameters update dynamically by user operation. Refresh user curve. Generate a review plan by user forgetting curve.Unlike other wordmemory system, This system is base-on Ebbinghaus Curve so it can update C urve’s parameters dynamically.It means that it becomes more in accordance with human’s memory level. This system code in Java and it applied technique like: SQL programming, Struts2, JSON, Ajax, ExtJS.Key Words: Ebbinghaus Forgetting Curve;WordMemory system; Refresh user curve目录第1章开发背景 (1)1.1 目的和意义 (1)1.2 设计思想 (1)1.3 开发目标 (2)第2章使用技术说明 (3)2.1 Struts2 (3)2.2 SQL编程 (3)2.3 AJAX与ExtJS (3)2.4 JSON轻量级数据格式简介 (4)第3章系统需求分析 (5)3.1 引言 (5)3.1.1 项目背景 (5)3.1.2 假定和约束 (5)3.2 系统总体结构图 (5)3.3 系统功能模块分解 (6)3.3.1 用户模块 (6)3.3.2 词库模块 (6)3.3.3 记忆曲线模块 (7)3.3.4 复习计划模块 (7)3.3.5 复习模块及浏览模块 (8)第4章系统概要设计 (9)4.1 系统设计思想 (9)4.2 系统总体设计 (9)4.3 系统工程分离 (9)4.4 系统类结构设计 (10)4.4.1 数据模型 (10)4.4.2 DAO层 (10)4.4.3 业务逻辑层 (11)4.4.4 控制层 (11)4.5 数据库设计 (12)4.5.1 E-R模型 (12)4.5.2 物理模型 (14)第5章核心业务逻辑介绍 (17)5.1 核心业务逻辑层简述 (17)5.2 记忆曲线的相关业务逻辑详解 (20)5.2.1 记忆曲线初始化 (20)5.2.2 记忆曲线参数更新 (20)5.2.3 记忆曲线更新 (21)5.3单词复习的业务逻辑详解 (23)5.3.1 任务列表初始化 (23)5.3.2 复习单词的过程 (24)5.4 单词卡片式浏览时的业务逻辑详解 (26)5.4.1 文字说明 (26)5.4.2 选择这种方式的原因 (27)5.4.3方法的优点 (27)第6章系统实现 (28)6.1 核心模块实现效果及说明 (28)6.1.1 首页 (28)6.1.2 复习模块页面 (28)6.1.3 单词浏览页面 (29)6.1.4 数据分析 (30)6.2 新技术应用 (31)6.2.1 Extjs、Ajax、JSON (31)第7章系统测试 (34)7.1 测试对象和要点 (34)7.2 测试环境 (34)7.3 测试用例 (34)第8章结论与展望 (37)8.1 结论 (37)8.2 展望 (38)结束语 (39)致谢 (40)参考文献 (1)第1章开发背景1.1 目的和意义目前英语地位日趋重要,单词的词汇量是一个人英语能力及水平极大的重要体现, 而背单词依旧是困扰许多人的地方,原因如下:英语单词多而繁杂,面对整整一本的单词词典人们总是望而却步,不从何入手。
基于Android平台的英语单词记忆软件的设计与实现

2020年第15期信息与电脑China Computer & Communication 软件开发与应用基于Android 平台的英语单词记忆软件的设计与实现许崇欣(南京理工大学紫金学院 计算机学院,江苏 南京 210023)摘 要:笔者介绍了基于Android 平台的英语单词记忆软件设计的基本理念,重点分析了基于Android 平台的英语单词记忆软件设计,包括英语单词软件设计的技术运用、英语单词记忆软件数据库设计、单词复习功能设计、英语单词学习功能设计、英语单词测试功能设计和生词本功能设计等,希望能够为相关研究提供借鉴。
关键词:Android 平台;英语单词记忆软件;复习功能;生词本功能中图分类号:TP393.08 文献标识码:A 文章编号:1003-9767(2020)15-100-02Design and Implementation of English Word Memory Software Based on Android PlatformXu Chongxin(School of Computing, Nanjing University of Science and Technology Zijin College, Nanjing Jiangsu 210023, China)Abstract: The author introduces the basic concept of English word memory software design based on Android platform, and analyzes the design of English word memory software based on Android platform, including the technical application of English word software design, the design of English word memory software database, the design of single word repetition function, the design of English word learning function, the design of English word test function and the new word book Functional design, hoping to provide reference for related research.Key words: Android platform; english word memory software; review function; new word function1 基于Android平台的英语单词记忆软件基于Android 平台开发的英语单词软件是对传统纸质单词的一种重要突破,改变了传统英语单词的查阅方式,更新了英语单词系统,含有较大的英语单词词汇量。
计算机二级考试《java》试题及答案

计算机二级考试《java》试题及答案计算机二级考试《java》试题及答案「篇一」1、以下不是Java中有效的关键字。
A、constB、NULLC、falseD、this本题考查的是Java的关键字。
Java中常量null,false,true,new,this,const,break都是小写。
故本题答案为B。
2、关于被私有访问控制符private修饰的成员变量,以下说法正确的是。
A、可以被三种类所引用:该类自身、与它在同一个包中的其他类、在其他包中的该类的子类B、可以被两种类访问和引用:该类本身、该类的所有子类C、只能被该类自身所访问和修改D、只能被同一个包中的类访问本题考查的是成员变量的修饰符。
private修饰的变量说明变量为私有访问。
只能被该类自己访问或调用,是对成员变量的高级保护。
故本题答案为C。
3、当检索一个压缩文件时,首先要建立压缩文件输入流对象。
该对象。
A、以选中的压缩文件为参数B、以FileInputStream对象为参数C、以InputStreamReader对象为参数D、以BufferedReader对象为参数本题考查的是压缩文件。
在java.io包中提供了对压缩文件进行操作的能力。
它是通过压缩文件输入流与压缩文件输出流来实现的,其分别继承自InflaterInputStream与DeflaterOutputStream。
在创建压缩文件输入流时,其初始化参数是一个FileInputStream类的实例。
故本题答案为B。
4、计算机中的流是______ 。
A、流动的字节B、流动的对象C、流动的文件D、流动的数据缓冲区本题考查的是流的概念。
流,最早从C语言中引入的。
其可以看成是一个流动的数据缓冲区。
数据从数据源方向经过缓冲区流向数据的目的地。
在传送的过程中,其传送方式是串行的。
在Java中的java.io包中定义了Java中常见流的接口与类。
其中包括两个最基本的流的抽象类,它们分别是OutputStream与InputStream。
艾宾浩斯记忆曲线 java 算法

艾宾浩斯记忆曲线 java 算法艾宾浩斯记忆曲线算法是一种帮助人们提高记忆效率的方法。
它的核心思想是在学习新知识时,遵循一定的时间规律进行复习,以加强记忆效果。
具体来说,艾宾浩斯记忆曲线将学习内容分为多个阶段,每个阶段都有相应的复习时间间隔。
随着复习次数的增加,复习时间间隔也越来越长,从而达到长期记忆的效果。
下面是一个基于Java语言实现的艾宾浩斯记忆曲线算法:```javaimport java.time.Duration;import java.time.LocalDateTime;import java.util.ArrayList;import java.util.List;public class EbbinghausMemoryCurve {private List<Item> itemList;public EbbinghausMemoryCurve() {itemList = new ArrayList<>();// 初始化,将第一次复习时间设置为当前时间itemList.add(new Item(LocalDateTime.now()));}/*** 获取下一次复习时间* @return LocalDateTime 下一次复习时间*/public LocalDateTime getNextReviewTime() {// 获取最近一次复习的ItemItem lastItem = itemList.get(itemList.size() - 1);// 通过计算当前时间与上次复习时间的时间差,来确定下一次复习时间Duration duration =Duration.between(lastItem.getReviewTime(),LocalDateTime.now());long days = duration.toDays();// 根据时间间隔公式计算下一次复习时间int nextInterval = 0;if (itemList.size() == 1) {nextInterval = 1;} else if (itemList.size() == 2) {nextInterval = 6;} else {nextInterval = (int) (itemList.get(itemList.size() - 1).getInterval() * 1.3);}LocalDateTime nextReviewTime =lastItem.getReviewTime().plusDays(nextInterval);// 将新的复习时间添加进ListitemList.add(new Item(nextReviewTime));return nextReviewTime;}private class Item {private LocalDateTime reviewTime;private int interval;public Item(LocalDateTime reviewTime) {this.reviewTime = reviewTime;this.interval = 0;}public LocalDateTime getReviewTime() {return reviewTime;}public int getInterval() {return interval;}}}```以上代码实现了艾宾浩斯记忆曲线的核心逻辑,具体来说,包含以下步骤:1. 初始化,将第一次复习时间设置为当前时间。
《Java项目开发实训教程》(宗哲玲)305-7课件 第1阶段 项目启动

数据库编程能力 数据库编程能力
系统分析、规划、设计、 实现、测试、部署能力 小型项目开发能力
第 6 页 共 20 页
项目目标
第1阶段 项目启动
项目目标
诚信做人
3.素质目标
three
树立行业意识、团队意识
培养协作、沟通、表达能力
树立终生学习、快乐学习、自主学习的意识
树立敢于创新、善于创新的意识
培养积极进取、乐观向上、健康平和的学习和工作心态
two 2. 任务
第 13 页 共 20 页
第1阶段 项目启动
项目组与任务
two 2.任务
详细设计 由开发经理、系统架构师或系统分析师,根据概要设计,对每一个模块进 行更为精确的结构化及层次化的描述。
用户界面设计 主要由界面设计师、系统分析师完成。用户界面好比人的外表,赏心悦目 会更吸引人。所以,用户界面要力求做到美观大方。
第 4 页 共 20 页
第1阶段 项目启动
one 1. 知识目标
项目目标
Java基本语法规范 面向对象程序设计思想 Java核心技术 Java技术应用 Java软件开发
第 5 页 共 20 页
第1阶段 项目启动
two 2.技能目标
搭建Java开发环境能力 技术文档阅读能力 技术文档阅读能力 编码、调试能力 编码、调试能力
第 12 页 共 20 页
第1阶段 项目启动
项目组与任务
需求分析
由项目经理的带领,需求分析师、开发和测试团队中的资深工程师参 与,负责进行用户访谈,从用户访谈中归纳、抽取、总结出用户需求, 完成定义场景和用户用例,以及编写需求说明书等工作。需求直接决 定系统的功能。
体系结构设计
由系统架构师或资深开发工程师,根据软件 需求说明书中定义的系统功能需求和非功能 需求,进行体系结构设计。体系结构设计就 如同人的骨架,若最初是一只猴子的骨架, 后期再丰富也不可能变成人,所以体系结构 设计的好坏决定了系统的构架的好坏。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
//主类MemoryGameimport javax.swing.*;import java.awt.*;import java.awt.event.*;import java.io.*;import java.util.LinkedList;public class MemoryGame extends JFrame implements ActionListener{ JMenuBar bar;JMenu menuGrade,menuResult,menuIcon;JMenuItem oneGradeItem,twoGradeItem,threeGradeItem;JMenuItem oneGradeResult,twoGradeResult,threeGradeResult;JMenuItem carImageIcon,animalImageIcon;File fileOneGrade,fileTwoGrade,fileThreeGrade,gradeFile;String imageName[];MemoryTestArea memoryArea;ShowRecordDialog showDiolag=null;int m=5,n=6;final int imageNumber=7;MemoryGame(){fileOneGrade=new File("初级记忆排行榜.txt");fileTwoGrade=new File("中级记忆排行榜.txt");fileThreeGrade=new File("高级记忆排行榜.txt");bar=new JMenuBar();menuGrade=new JMenu("选择级别");oneGradeItem=new JMenuItem("初级");twoGradeItem=new JMenuItem("中级");threeGradeItem=new JMenuItem("高级");menuGrade.add(oneGradeItem);menuGrade.add(twoGradeItem);menuGrade.add(threeGradeItem);menuResult=new JMenu("查看排行榜");oneGradeResult=new JMenuItem("初级排行榜");twoGradeResult=new JMenuItem("中级排行榜");threeGradeResult=new JMenuItem("高级排行榜");menuResult.add(oneGradeResult);menuResult.add(twoGradeResult);menuResult.add(threeGradeResult);menuIcon=new JMenu("选择图标");carImageIcon=new JMenuItem("汽车图标");animalImageIcon=new JMenuItem("动物图标");animalImageIcon.addActionListener(this);carImageIcon.addActionListener(this);menuIcon.add(carImageIcon);menuIcon.add(animalImageIcon);bar.add(menuGrade);bar.add(menuResult);bar.add(menuIcon);setJMenuBar(bar);oneGradeItem.addActionListener(this); twoGradeItem.addActionListener(this); threeGradeItem.addActionListener(this); oneGradeResult.addActionListener(this); twoGradeResult.addActionListener(this); threeGradeResult.addActionListener(this);if(!fileOneGrade.exists()){try { fileOneGrade.createNewFile();}catch(IOException exp){}}if(!fileTwoGrade.exists()){try { fileTwoGrade.createNewFile();}catch(IOException exp){}}if(!fileThreeGrade.exists()){try { fileThreeGrade.createNewFile();}catch(IOException exp){}}setBounds(100,100,400,360);setVisible(true);memoryArea=new MemoryTestArea();imageName=new String[imageNumber];for(int i=0;i<imageName.length;i++){imageName[i]=new String("car"+i+".jpg");}m=5;n=6;gradeFile=fileOneGrade;memoryArea.initBlock(m,n,imageName,gradeFile); add(memoryArea,BorderLayout.CENTER); showDiolag=new ShowRecordDialog();validate();setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }public void actionPerformed(ActionEvent event){if(event.getSource()==oneGradeItem){m=5;n=6;gradeFile=fileOneGrade;memoryArea.initBlock(m,n,imageName,gradeFile); }if(event.getSource()==twoGradeItem){m=6;n=7;gradeFile=fileTwoGrade;memoryArea.initBlock(m,n,imageName,gradeFile); }if(event.getSource()==threeGradeItem){m=7;n=8;gradeFile=fileThreeGrade;memoryArea.initBlock(m,n,imageName,gradeFile); }if(event.getSource()==carImageIcon){for(int i=0;i<imageName.length;i++){imageName[i]=new String("car"+i+".jpg");}memoryArea.setImageName(imageName);memoryArea.initBlock(m,n,imageName,gradeFile); }if(event.getSource()==animalImageIcon){for(int i=0;i<imageName.length;i++){imageName[i]=new String("ani"+i+".jpg");}memoryArea.setImageName(imageName);memoryArea.initBlock(m,n,imageName,gradeFile); }if(event.getSource()==oneGradeResult){showDiolag.setGradeFile(fileOneGrade);showDiolag.showRecord();showDiolag.setVisible(true);}if(event.getSource()==twoGradeResult){showDiolag.setGradeFile(fileTwoGrade);showDiolag.showRecord();showDiolag.setVisible(true);}if(event.getSource()==threeGradeResult){showDiolag.setGradeFile(fileThreeGrade);showDiolag.showRecord();showDiolag.setVisible(true);}}public static void main(String args[]){new MemoryGame();}}//MemoryTestArea类import javax.swing.*;import java.awt.event.*;import java.awt.*;import java.util.*;import java.io.*;public class MemoryTestArea extends JPanel implements ActionListener,Runnable { int row,col;File gradeFile;ArrayList<Block> allBlockList;String imageFileName[];LinkedList<ImageIcon> openIconList;LinkedList<Block> openBlockList;int success=0;Thread hintThead;JButton hintButton;int usedTime=0;JTextField showUsedTime,hintMessage;javax.swing.Timer timer;Record record;JPanel center,south;MemoryTestArea(){setLayout(new BorderLayout());allBlockList=new ArrayList<Block>();openIconList=new LinkedList<ImageIcon>();openBlockList=new LinkedList<Block>();hintThead=new Thread(this);hintMessage=new JTextField();hintMessage.setHorizontalAlignment(JTextField.CENTER);hintMessage.setEditable(false);hintMessage.setFont(new Font("宋体",Font.BOLD,18));center=new JPanel();south=new JPanel();hintButton=new JButton("提示");hintButton.addActionListener(this);showUsedTime=new JTextField(8);showUsedTime.setEditable(false);showUsedTime.setHorizontalAlignment(JTextField.CENTER);south.add(new JLabel("用时:")) ;south.add(showUsedTime);south.add(new JLabel("提示图标位置(导致用时增加):")) ;south.add(hintButton);add(south,BorderLayout.SOUTH);add(hintMessage,BorderLayout.NORTH);timer=new javax.swing.Timer(1000,this);record=new Record();}public void initBlock(int m,int n,String name[],File f){ row=m;col=n;gradeFile=f;center.removeAll();imageFileName=name;ImageIcon icon[]=new ImageIcon[imageFileName.length];for(int i=0;i<icon.length;i++){icon[i]=new ImageIcon(imageFileName[i]);}if(allBlockList.isEmpty()){for(int i=0;i<row*col;i++){allBlockList.add(new Block());}}else{allBlockList.clear();for(int i=0;i<row*col;i++){allBlockList.add(new Block());}}for(int i=0;i<allBlockList.size();i++){allBlockList.get(i).addActionListener(this);allBlockList.get(i).setOpenStateIcon(icon[i%row]);}Collections.shuffle(allBlockList);center.setLayout(new GridLayout(row,col));for(int i=0;i<allBlockList.size();i++){center.add(allBlockList.get(i));}add(center,BorderLayout.CENTER);if(timer.isRunning()){timer.stop();}hintMessage.setText("您需要用鼠标单击出"+col+"个同样图标的方块");usedTime=0;showUsedTime.setText(null);validate();}public void setImageName(String name[]){imageFileName=name;}public void actionPerformed(ActionEvent e){if(e.getSource() instanceof Block){if(!timer.isRunning())timer.start();Block block=(Block)e.getSource();ImageIcon openStateIcon=block.getOpenStateIcon();block.setIcon(openStateIcon);if(openIconList.size()==0) {openIconList.add(openStateIcon);openBlockList.add(block);success=1;}else{ImageIcon temp=openIconList.getLast();if(temp==openStateIcon&&!(openBlockList.contains(block))){success=success+1;openIconList.add(openStateIcon);openBlockList.add(block);if(success==col){for(int i=0;i<allBlockList.size();i++){allBlockList.get(i).setEnabled(false);}for(int j=0;j<openBlockList.size();j++){Block b=openBlockList.get(j);b.setDisabledIcon(b.getOpenStateIcon());}timer.stop();record.setTime(usedTime);record.setGradeFile(gradeFile);record.setVisible(true);}}else if((temp!=openStateIcon)&&(!(openBlockList.contains(block)))){ openIconList.clear();openBlockList.clear();openIconList.add(openStateIcon);openBlockList.add(block);success=1;for(int i=0;i<allBlockList.size();i++){if(allBlockList.get(i)!=block)allBlockList.get(i).setIcon(null);}}}}if(e.getSource()==hintButton){if(!hintThead.isAlive())hintThead=new Thread(this);for(int i=0;i<allBlockList.size();i++)allBlockList.get(i).removeActionListener(this);usedTime=usedTime+10;try{hintThead.start();}catch(IllegalThreadStateException ex){}}if(e.getSource()==timer){usedTime++;showUsedTime.setText("您的用时:"+usedTime+"秒");}}public void run(){for(int i=0;i<allBlockList.size();i++)allBlockList.get(i).setIcon(allBlockList.get(i).getOpenStateIcon());try{ Thread.sleep(1200);}catch(InterruptedException exp){}for(int i=0;i<allBlockList.size();i++)allBlockList.get(i).addActionListener(this);for(int i=0;i<allBlockList.size();i++)if(!openBlockList.contains(allBlockList.get(i)))allBlockList.get(i).setIcon(null);}}//Block 类import javax.swing.*;import java.awt.event.*;public class Block extends JButton {ImageIcon openStateIcon;public ImageIcon getOpenStateIcon(){return openStateIcon;}public void setOpenStateIcon(ImageIcon icon){openStateIcon=icon;}}//Record类import java.io.*;import java.util.*;import javax.swing.*;import java.awt.event.*;import java.awt.*;public class Record extends JDialog implements ActionListener{ int time=0;JTextField yourName;JLabel label;JButton enter,cancel;File gradeFile=null;public Record(){setBounds(100,100,330,160);setResizable(false);setModal(true);setVisible(false);enter=new JButton("确定");cancel=new JButton("取消");yourName=new JTextField(8);yourName.setText("匿名");enter.addActionListener(this);cancel.addActionListener(this);setLayout(new GridLayout(2,1));label=new JLabel();add(label);JPanel p=new JPanel();p.add(yourName);p.add(enter);p.add(cancel);add(p);}public void setGradeFile(File f){gradeFile=f;setTitle("保存成绩到"+gradeFile.getName());label.setText("保存成绩到"+gradeFile.getName());validate();}public void setTime(int time){this.time=time;}public void actionPerformed(ActionEvent e){if(e.getSource()==enter){LinkedList<People> list=new LinkedList<People>();try{RandomAccessFile out=new RandomAccessFile(gradeFile,"rw");out.seek(out.length());out.writeUTF(yourName.getText());out.writeInt(time);out.close();}catch(Exception event) {}setVisible(false);}if(e.getSource()==cancel){setVisible(false);}}}//ShowRecordDialog 类import java.io.*;import java.util.*;import javax.swing.*;import java.awt.event.*;import java.awt.*;public class ShowRecordDialog extends JDialog implements ActionListener{ File gradeFile;JButton clear;JTextArea showArea=null;TreeSet<People> treeSet;public ShowRecordDialog(){treeSet=new TreeSet<People>();showArea=new JTextArea(6,4);showArea.setFont(new Font("楷体",Font.BOLD,20));clear=new JButton("清空排行榜");clear.addActionListener(this);add(new JScrollPane(showArea),BorderLayout.CENTER);add(clear,BorderLayout.SOUTH);setBounds(100,100,320,185);setModal(true);addWindowListener(new WindowAdapter(){public void windwoClosing(WindowEvent e){setVisible(false);}});}public void setGradeFile(File f){gradeFile=f;setTitle(f.getName());}public void showRecord(){showArea.setText(null);treeSet.clear();try{RandomAccessFile in=new RandomAccessFile(gradeFile,"rw");long fileLength=in.length();long readPosition=0;while(readPosition<fileLength){String name=in.readUTF();int time=in.readInt();readPosition=in.getFilePointer();People people=new People(name,time);treeSet.add(people);}in.close();Iterator<People> iter=treeSet.iterator();while(iter.hasNext()){People p=iter.next();showArea.append("姓名:"+p.getName()+",成绩: "+p.getTime()+"秒");showArea.append("\n");}}catch(IOException exp){System.out.println(exp);}}public void actionPerformed(ActionEvent e){if(e.getSource()==clear){try{File f=gradeFile.getAbsoluteFile();gradeFile.delete();f.createNewFile();showArea.setText("排行榜被清空");}catch(Exception ee){}}}}//ShowRecord类import java.io.*;import java.util.*;import javax.swing.*;import java.awt.event.*;import java.awt.*;public class ShowRecord extends JDialog implements ActionListener{File gradeFile;JButton clear;JTextArea showArea=null;People people;TreeSet<People> treeSet;public ShowRecord(File f){treeSet=new TreeSet<People>();showArea=new JTextArea(6,4);clear=new JButton("清空排行榜");clear.addActionListener(this);add(new JScrollPane(showArea),BorderLayout.CENTER);add(clear,BorderLayout.SOUTH);setBounds(100,100,320,185);setModal(true);addWindowListener(new WindowAdapter(){public void windwoClosing(WindowEvent e){setVisible(false);}});}public void setGradeFile(File f){gradeFile=f;setTitle(f.getName());}public void showRecord(){try{RandomAccessFile in=new RandomAccessFile(gradeFile,"rw");String name=null;while((name=in.readUTF())!=null){int time=in.readInt();people =new People(name,time);treeSet.add(people);}Iterator<People> iter=treeSet.iterator();while(iter.hasNext()){People p=iter.next();showArea.append("姓名:"+p.getName()+"成绩: "+p.getTime());showArea.append("\n");}}catch(IOException exp){}}public void actionPerformed(ActionEvent e){if(e.getSource()==clear){try{File f=gradeFile.getAbsoluteFile();gradeFile.delete();f.createNewFile();showArea.setText("排行榜被清空");}catch(Exception ee){}}}}//People类import java.io.*;public class People implements Serializable,Comparable{String name=null;int time=0;public People(String name,int t){=name;time=t;}public int getTime(){return time;}public String getName(){return name;}public int compareTo(Object b){People p=(People)b;if((this.time-p.time)==0)return 1;elsereturn (this.time-p.time);}}PS:以上各类的代码要放在不同的java格式的文档中。