码迷,mamicode.com
首页 > 其他好文 > 详细

My parnter code review

时间:2017-03-24 23:08:15      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:电子邮件   extends   style   有符号   cas   textfield   password   span   sage   

1.建议修改的代码:

public class Jiemian extends JFrame {
 23 
 24     private JPanel contentPane;
 25     
 26     
 27         private JTextField username;
 28         private JTextField email;
 29         private JPasswordField password;
 30         private JLabel man;

意见:这个类的名字太过随意,可能有时候让人不理解

修改如下:

 22 public class interface extends JFrame {
 23 
 24     private JPanel contentPane;
 25     
 26     
 27         private JTextField username;
 28         private JTextField email;
 29         private JPasswordField password;
 30         private JLabel man;

 

2.建议修改的代码:

150                         switch (n) {
151                    case 0:
152                    JOptionPane.showMessageDialog(button_1,
153                    "用户名:" + name1 + "\n" + "性别:"  xb + "\n" + "电子邮件:"  mail + "\n" + "爱好:" + role1);
154                         }
155             }
156 
157                 }
158             });

意见:大括号的位置随意摆放,凌乱

修改如下:

150                         switch (n) {
151                     case 0:
152                     JOptionPane.showMessageDialog(button_1,
153                     "用户名:" + name1 + "\n" + "性别:" xb + "\n" + "电子邮件:"  mail + "\n" + "爱好:" + role1);
154             }
155         }
156 
157      }
158    });

3.建议修改的代码:

                        switch (n) {
151               case 0:
152               JOptionPane.showMessageDialog(button_1,
153               "用户名:" + name1 + "\n" + "性别:" xb + "\n" + "电子邮件:"  mail + "\n" + "爱好:" + role1);
154                         }
155             }
156 

意见:行的长度,缩进有问题,看着不舒服,还有符号也漏掉了

修改如下:

                             switch (n) {
151                          case 0:
152                             JOptionPane.showMessageDialog(button_1,
153                             "用户名:" + name1 + "\n" + "性别:" + xb + "\n" + "电子邮件:" + mail + "\n" + "爱好:" + role1);
154                         }
155             }
156 

 

My parnter code review

标签:电子邮件   extends   style   有符号   cas   textfield   password   span   sage   

原文地址:http://www.cnblogs.com/LT1997/p/6613690.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!