0414 结对2.0

结对项目:复利计算

 搭档:201406114232朱杰  

 搭档博客园地址:http://www.cnblogs.com/alfredzhu/

 github:https://github.com/alfredzhu/teamwork

复利计算再升级——

客户在大家的引导下,有了更多的想法:

  1. 这个数据我经常会填.....帮我预先填上呗?......
  2. 把界面做得简单漂亮好操作一点呗?
  3. 能不能帮我转成个APP,我装到手机上就更方便了?
  4. 我觉得这个很有用,很多人可能都需要这些功能,做到我的微信公众号上吧?
  5. 能不能不要让我填表单,让我发条消息,或者对着手机说句话就可以了?

每组选一两个方向加以改进,让我们的投资计算与记录工具,达到可以发布给用户使用的版本,并发布博客对此次更新进行说明与总结。

------------------------------------------------------------------------------------------------------------------------------------------

我们组选择的方向:1.2

预计用时: 3H           

实际用时:2.5H

新增函数:

预填参数:

 1 String x = ""; 2 String y = ""; 3 String z = "";  

预填功能:

 1 private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {
 2         // 预填数据
 3         Object[] obj2 = { "本金", "利率", "年限" };
 4         String s = (String) JOptionPane.showInputDialog(null, "请选择你需要预填的数据:
",
 5                 "预填", JOptionPane.PLAIN_MESSAGE, new ImageIcon("icon.png"),
 6                 obj2, "利率");
 7         if (s == "本金") {
 8             if (action == 0 || action == 1 || action == 2 || action == 4
 9                     || action == 5 || action == 6 || action == 7 || action == 8) {
10                 x = (String) JOptionPane.showInputDialog(null, "请输入预填的本金:
",
11                         "预填值", JOptionPane.PLAIN_MESSAGE, null, null, "在这输入");
12                 jTextField1.setText("" + x);
13             }
14         }
15         if (s == "利率") {
16             if (action == 0 || action == 1 || action == 2 || action == 3
17                     || action == 4 || action == 6 || action == 7 || action == 8) {
18                 y = (String) JOptionPane.showInputDialog(null, "请输入预填的利率:
",
19                         "预填值", JOptionPane.PLAIN_MESSAGE, null, null, "在这输入");
20                 jTextField2.setText("" + y);
21             }
22         }
23         if (s == "年限") {
24             if (action == 0 || action == 1 || action == 2 || action == 3
25                     || action == 4 || action == 6 || action == 7 || action == 8) {
26                 z = (String) JOptionPane.showInputDialog(null, "请输入预填的年限:
",
27                         "预填值", JOptionPane.PLAIN_MESSAGE, null, null, "在这输入");
28                 jTextField3.setText("" + z);
29             }
30             if (action == 5) {
31                 z = (String) JOptionPane.showInputDialog(null, "请输入预填的年限:
",
32                         "预填值", JOptionPane.PLAIN_MESSAGE, null, null, "在这输入");
33                 jTextField2.setText("" + z);
34             }
35         }
36     }

插入背景:

 1 //将背景图绘在JFrame的倒数第二底层的Layeredpane上
 2           JLabel   picLabel   =   new   JLabel(); 
 3           picLabel.setIcon(new   ImageIcon( "under.jpg")); 
 4           this.getLayeredPane().add(picLabel, new Integer(Integer.MIN_VALUE));
 5           picLabel.setBounds(0,0,1000,705);
 6          
 7         //再在JFrame的最上层contentpane上添加按钮并且设置contentpane为透明。
 8           JPanel content = new JPanel();
 9           content=(JPanel)getContentPane();  
10           content.setOpaque(false);
11         //  content.add(monthOrWeekPlanBtn);

运行结果:

总结:

      第二次的结对编程,我感觉比第一次的默契度有所提高,合作的效率也上升。一开始面对问题也是会有各自的想法

,接着我们会提出自己的所有见解,然后再分析,想想更加完美的解决方法。最后在沟通,思考后我们就会更加了解对

方的想法,再朝一个方向前进,很多问题都迎刃而解,效率也跟着提高,感觉很不错。

原文地址:https://www.cnblogs.com/cjh123/p/5393354.html