文档介绍:.*;.*;.*;;.*;.*;classLoginextendsJFrameimplementsActionListener{ Containercp=null;JFramef=null;JButtonj1,j2;JTextFieldt1;JPasswordFieldt2;JLabeljlable1,jlable2;Colorc;JPaneljp1,jp2;Login(){f=newJFrame("小型图书管理系统");j1=newJButton("确定");j2=newJButton("取消");cp=();jlable1=newJLabel("输入用户名");jlable2=newJLabel("用户密码");jp1=newJPanel();jp2=newJPanel();t1=newJTextField(18);t2=newJPasswordField(18);(jlable1);(t1);(jlable2);(t2);JLabelJL=newJLabel("<html><fontcolor=#CC00FFsize='7'><i>欢迎登录</i></font>",);(JL,"North");(j1);(j2);(jp1,"Center");("South",jp2);(newColor(255,155,255));Toolkitkit=();Dimensionscreen=();intx=; /*取得显示器窗口的宽度*/inty=; /*取得显示器窗口的高度*///setSize(x,y);/*让系统窗口平铺整个显示器窗口*/(300,300);intxcenter=(x-300)/2;intycenter=(y-300)/2;(xcenter,ycenter);/*显示在窗口中央*/(true);//-----------------------------------------------------(this);//(this);(newWindowAdapter(){publicvoidwindowClosing(WindowEvente){(0);}});}publicvoidconfirm()//验证用户和密码是否存在{try{("");}catch(ClassNotFoundExceptione){("加载驱动程序失败!");}try{Connectioncon=("jdbc:odbc:TEST","SYSTEM","SYSTEM");Statementsql=();Stringuname=().trim();StringMima=().trim();StringqueryMima="select*fromYONGHUwhere用户名='"+uname+"'AND密码='"+Mima+"'";ResultSetrs=(queryMima);if(()){newBook(uname);();();}else{(null,"该用户不存在","提示!",);}("");("");}catch(SQLExceptiong){("ECode"+());