java课程设计--猜数字(团队博客)

java课程设计--猜数字(团队博客)

1.团队名称以及团队成员介绍

团队名称:cz
团队成员:陈伟泽,詹昌锦
团队照片:html

2.项目git地址

http://git.oschina.net/Devil299/java201521123111/tree/master/gamejava

3.项目git提交记录

4.项目功能流程图与主要功能流程图

运行项目截图






5.项目的关键代码

比较数据代码:git

private static int answer;
    private static java.util.Date start, end;
    private long diff;
private void sureActionPerformed(java.awt.event.ActionEvent evt) {
        int g = Integer.parseInt(GES.getText());

        if (g != answer) {
            if (g < answer) {
                AND.setText("too small");
            } else if (g > answer) {
                AND.setText("too big");

            }
        } else {
            end = new java.util.Date();
            diff = end.getTime() - start.getTime();
            AND.setText("right");
            
            this.setVisible(false);
            
            new MyDialog().setVisible(true);
        }

排行榜代码:数据库

public paihang() throws FileNotFoundException {    
        initComponents();
        arrayList = new ArrayList<>();
        File datafile = new File("D:\\data.txt");
        Scanner scanner = new Scanner(new FileInputStream(datafile));
        while (scanner.hasNextLine()) {
            String string = scanner.nextLine();
            String[] strings = string.split(" ");
            arrayList.add(new User(strings[0], Long.parseLong(strings[1])));
        }
        
        Collections.sort(arrayList);
        
        for (int i = 0; i < arrayList.size(); i++) {
            String username = arrayList.get(i).username;
            String time = arrayList.get(i).time + "";
            if (i == 0) {
                jLabel4.setText(username);
                jLabel7.setText(time);
            } else if (i == 1) {
                jLabel6.setText(username);
                jLabel10.setText(time);
            } else if (i == 2) {
                jLabel5.setText(username);
                jLabel8.setText(time);
            } else {
                break;
            }
        }

        scanner.close();
        
    }

6.尚待改进或者新的想法

1.用教室的电脑总会出现七七八八的问题;
2.界面不太美观;
3.想要尝试可否多用户进行尝试;
4.想将文本文件存储改为数据库存储;
5.想学更牛逼的操做!this

7.团队成员任务分配,团队成员课程设计博客连接(以表格形式显示,代表组长)

陈伟泽(组长)http://www.cnblogs.com/yudi/p/7063528.html
负责博客方面,排行榜的设计,使用netbeans设计部分界面,用文本文件存储信息。
詹昌锦(组员)http://www.cnblogs.com/zcjj/p/7064020.html
负责输入输出界面以及代码,开始猜数游戏,对数据比较进行处理。.net

相关文章
相关标签/搜索