軟件工程網絡15結對編程做業(201521123111 陳偉澤)

1.成員:

陳偉澤
詹昌錦
碼雲html

2.不會

給個圖:

選擇博客:http://www.cnblogs.com/shizhuangde/p/6552441.html
代碼:https://coding.net/u/lhl1212/p/ArithmeticTest/git?public=true
需求分析:
有了界面
語言選擇
四則運算
計時功能
增量計算git

改進:
增長個準確率斷定會好一點。.net

原有代碼:code

語言選擇功能:htm

public void setLanguage() {
        String[] choiceLanguage = { "簡體中文", "繁體中文", "English" };
        String language = (String) JOptionPane.showInputDialog(null, "請選擇客戶端的語言:\n", "Choice a language for client",
                JOptionPane.PLAIN_MESSAGE, new ImageIcon("icon.png"), choiceLanguage, "簡體中文");
        if (language == null) {
            System.exit(-1);
        } else {
            try {
                reader = new BufferedReader(new FileReader(new File("language/" + language + ".txt")));
                String s;
                while ((s = reader.readLine()) != null) {
                    tips.add(s);
                }
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

計時功能blog

public void showTime() {
        labTime = new JLabel(tips.get(1) + "00:00");
        labTime.setBounds(50, 0, 120, 50);
        jpMain.add(labTime);
        new Thread() {
            public void run() {
                while (true) {
                    try {
                        Thread.sleep(1000);
                        seconds++;
                        if (seconds >= 60) {
                            seconds = 0;
                            minutes++;
                        }
                        if (seconds < 10)
                            secStr = "0" + seconds.toString();
                        else
                            secStr = seconds.toString();
                        if (minutes < 10)
                            minStr = "0" + minutes.toString();
                        else
                            minStr = minutes.toString();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    labTime.setText(tips.get(1) + minStr + ":" + secStr);
                    if(isEnd)
                        break;
                }
            }
        }.start();
    }

boom!ip

3感覺

沒什麼特別的感覺吧,有點後悔讀這個專業了。嗯。get

相關文章
相關標籤/搜索