次的密码相同,才能成功注册,管理员登陆窗口如图4-3所示。Р图4-3 管理员添加成功界面Р主要程序代码如下:Р public void actionPerformed(ActionEvent c)Р?{Р String b=textUser.getText();Р String d=textPassword1.getText();Р String g=textPassword2.getText();Р if(c.getSource()==buttonqk)Р {?textUser.setText(null);Р textPassword1.setText(null);Р textPassword2.setText(null);Р }Р if(c.getSource()==buttonEnter||c.getSource()==textPassword2)Р {Р Р if(b.length()<3||b.length()>10)Р {Р JOptionPane.showMessageDialog(null,"用户名应在3~10个字符之间");Р textUser.setText(null); Р }Р elseР {Р try {?Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Р }Р catch(ClassNotFoundException e)Р {?System.out.println(""+e);Р }Р try {?con=DriverManager.getConnection("jdbc:odbc:sun","123","123");Р sql=con.createStatement();Р rs=sql.executeQuery("SELECT * FROM Admi WHERE 用户名="+"'"+b+"'");