1.MIS_frame类packageMIS_Login;importjava.awt.Container;importjava.awt.Cursor;importjava.awt.Dimension;importjava.awt.FlowLayout;importjava.awt.GridLayout;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.awt.event.MouseAdapter;importjava.awt.event.MouseEvent;importjavax.swing.ButtonGroup;importjavax.swing.ImageIcon;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JOptionPane;importjavax.swing.JPanel;importjavax.swing.JPasswordField;importjavax.swing.JRadioButton;importjavax.swing.JTextField;/***总目标:*1.一个用户名输入框,一个密码输入框*2.就一个登陆的按钮*3.加一组JRadioButton,一个是管理员,一个是学生用户*4.两个超链接,一个是忘记密码,一个是用户注册**用户注册:*1.。。。只面向的是学生用户,不对管理员开放*2.注册的时候只有接受协议的时候,才能跳到下一步详细信息的填写。*3.包括的信息:学号,姓名,用户名,邮箱名,密码,确认密码,(5)个基本信息,两个按钮,确认与取消*4.学号必须是系统存在的。两次的密码必须是一致的。符合的话,给出注册成功的信息,否则给出提示信息*5.dispose(),返回到登陆界面**忘记密码:*1.一个窗体,必须先填写用户名,先匹配数据库,给出提示,*2.如果存在用户名,提示信息,“已向***(邮箱),发送验证码”,释放原先的窗体,弹出一个新的窗体,*包含的内容有:用户名(不可修改),验证码,新的密码,确认密码。*3.验证码正确,提示,否则,提示。。****/importStudent.SubFrame.all.AllFrame_stu;importAdmin.SubFrame.all.Allframe_admin;publicclassMIS_frameimplementsActionListener{publicJButtonb_login;publicJLabellab_username,lab_pwd;publicJTextFieldtxt_login;publicJPasswordFieldtxt_pwd;publicJLabellab_forget,lab_register;publicJRadioButtonb_admin_login,b_stu_login;publicJPanelMIS_p1,MIS_p2,MIS_p3,MIS_p4,MIS_p5;publicJFramemis_frame;publicvoidMIS_display(){MIS_p1=newJPanel();lab_username=newJLabel(用户名:);txt_login=newJTextField(15);MIS_p1.add(lab_username);MIS_p1.add(txt_login);MIS_p1.setLayout(newFlowLayout(FlowLayout.CENTER,0,40));MIS_p2=newJPanel();lab_pwd=newJLabel(密码:);txt_pwd=newJPasswordField(15);MIS_p2.add(lab_pwd);MIS_p2.add(txt_pwd);MIS_p2.setLayout(newFlowLayout(FlowLayout.CENTER,0,15));MIS_p3=newJPanel();b_login=newJButton(登陆);MIS_p3.add(b_login);MIS_p3.setLayout(newFlowLayout(FlowLayout.CENTER,0,15));MIS_p4=newJPanel();b_admin_login=newJRadioButton(管理员,true);b_stu_login=newJRadioButton(学生用户);ButtonGroupbg_login_button=newButtonGroup();bg_login_button.add(b_admin_login);bg_login_button.add(b_stu_login);MIS_p4.add(b_admin_login);MIS_p4.add(b_stu_login);MIS_p4.setLayout(newFlowLayout(FlowLayout.CENTER,10,15));MIS_p5=newJPanel();lab_forget=newJLabel(htmlahref=#忘记密码/a/br+);lab_register=newJLabel(htmlahref=#注册/a/br);MIS_p5.add(lab_forget);MIS_p5.add(lab_register);MIS_p5.setLayout(newFlowLayout(FlowLayout.CENTER));lab_forget.setCursor(newCursor(Cursor.HAND_CURSOR));lab_register.setCursor(newCursor(Cursor.HAND_CURSOR));//ImageIconimg=newImageIcon(D:\\2013-2014课程表.png);//JLabelimgLabel=newJLabel(img);//将背景图放在标签里。////jf.getLayeredPane().add(imgLabel,newInteger(Integer.MIN_VALUE));//imgLabel.setBounds(0,0,img.getIconWidth(),img.getIconHeight());//mis_frame=newJFrame();Containermis_container=mis_frame.getContentPane();mis_container.add(MIS_p1);mis_container.add(MIS_p2);mis_container.add(MIS_p4);mis_container.add(MIS_p3);mis_container.add(MIS_p5);mis_frame.setLayout(newGridLayout(5,1));mis_frame.setLocation(600,200);mis_frame.setPreferredSize(newDimension(500,350));mis_frame.pack();mis_frame.setVisible(true);//忘记密码鼠标监听lab_forget.addMouseListener(newMouseAdapter(){publicvoidmouseClicked(MouseEvente){newForget_pwd_frame().forget_button_function();}});//注册鼠标监听lab_register.addMouseListener(newMouseAdapter(){publicvoidmouseClicked(MouseEvente){System.out.println(注册!);newRegister_frame().statement_useragr_frame();}});//登陆按钮监听b_login.addActionListener(this);}//管理员登陆事件publicvoidaction_admin_login(){Stringsql_admin_login=select*fromLogin_admin_infowhereA_no=?;intadmin_login_flag=0;admin_login_flag=Search_sno_DB.serch_sno_from_stuDB(sql_admin_login,txt_login.getText());if(admin_login_flag==1){newAllframe_admin().buttonFunction();//mis_frame.dispose();txt_login.setText(null);txt_pwd.setText(null);}else{JOptionPane.showMessageDialog(null,登录失败,请检查用户名密码,提示,0);}}//学生用户登陆publicvoidaction_stu_login(){Stringsql_admin_login=select*fromLogin_stu_infowhereSno=?;intstu_login_flag=0;stu_login_flag=Search_sno_DB.serch_sno_from_stuDB(sql_admin_login,txt_login.getText());if(stu_login_flag==1){newAllFrame_stu().all_stu_function();txt_login.setText(null);txt_pwd.setText(null);}else{JOptionPane.showMessageDialog(null,登录失败,请检查用户名密码,提示,0);}}//监听登陆按钮publicvoidactionPerformed(ActionEvente){if(e.getSource().equals(b_login)){//管理员登陆if(b_admin_login.isSelected()){action_admin_login();}//学生用户登陆elseif(b_stu_login.isSelected()){action_stu_login();}}}publicstaticvoidmain(String[]args){newMIS_frame().MIS_display();}}2.Info_user_reg_classpackageMIS_Login;importjava.awt.BorderLayout;importjava.awt.Container;importjava.awt.Dimension;importjava.awt.FlowLayout;importjava.awt.GridLayout;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.sql.PreparedStatement;importjava.sql.SQLException;importjavax.swing.*;importStudentDB.Interactive.StudentDB;publicclassInfo_user_reg_classextendsVerification_Test{publicJFrameinfo_user_reg;publicJLabellab_reg_sno,lab_reg_name,lab_reg_email,lab_reg_pwd,lab_reg_p