用java编写一个用户登陆界面用户验证通过数据库实现

用java编写一个用户登陆界面用户验证通过数据库实现

ID:8541937

大小:11.96 KB

页数:8页

时间:2018-03-31

用java编写一个用户登陆界面用户验证通过数据库实现_第1页
用java编写一个用户登陆界面用户验证通过数据库实现_第2页
用java编写一个用户登陆界面用户验证通过数据库实现_第3页
用java编写一个用户登陆界面用户验证通过数据库实现_第4页
用java编写一个用户登陆界面用户验证通过数据库实现_第5页
资源描述:

《用java编写一个用户登陆界面用户验证通过数据库实现》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、这是我以前写的系统登录框的loginpackagejava1;importjava.awt.*;importjava.awt.event.*;importjava.sql.*;importjava.util.*;importjavax.swing.*;importjavax.swing.event.*;importjava.awt.Rectangle;importjava.awt.Font;publicclassloginextendsJFrame{publiclogin(){try{jbInit();}catch(Exceptionex){ex.p

2、rintStackTrace();}}publicstaticvoidmain(String[]args){loginfrm=newlogin();frm.setBounds(300,200,300,260);frm.setVisible(true);}privatevoidjbInit()throwsException{this.getContentPane().setLayout(null);jLabel1.setForeground(Color.red);jLabel1.setText("用户名");jLabel1.setBounds(newR

3、ectangle(25,72,68,29));jButton2.setBounds(newRectangle(142,159,81,30));jButton2.setText("取消");jButton2.addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){jButton2_actionPerformed(e);}});jButton1.setBounds(newRectangle(38,159,81,29));jButton1.setText("

4、确定");jButton1.addActionListener(newActionListener(){publicvoidactionPerformed(ActionEvente){jButton1_actionPerformed(e);}});jTextField1.setBounds(newRectangle(109,79,136,23));jPasswordField1.setBounds(newRectangle(109,115,136,23));this.getContentPane().add(jLabel1);jLabel3.setF

5、ont(newjava.awt.Font("隶书",Font.PLAIN,24));jLabel3.setText("学生考试系统");jLabel3.setBounds(newRectangle(22,15,268,47));this.getContentPane().add(jTextField1);this.getContentPane().add(jLabel2);this.getContentPane().add(jButton2);this.getContentPane().add(jButton1);this.getContentPan

6、e().add(jLabel3);this.getContentPane().add(jPasswordField1);jLabel2.setForeground(Color.red);jLabel2.setText("密码");jLabel2.setBounds(newRectangle(26,112,68,29));}JLabeljLabel1=newJLabel();JLabeljLabel2=newJLabel();JTextFieldjTextField1=newJTextField();JButtonjButton1=newJButton

7、();JButtonjButton2=newJButton();JLabeljLabel3=newJLabel();JPasswordFieldjPasswordField1=newJPasswordField();main2wo=newmain2();intsum;//判断权限的方法publicvoidsuccess(){try{ResultSetrs1;Strings1="select*from管理权限wherename='"+jTextField1.getText()+"'andpassword='"+jPasswordField1.getTe

8、xt()+"'";rs1=sqlcx.Rs_jiluji(s1);rs1.first();sum=Integ

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。