为了正常的体验网站,请在浏览器设置里面开启Javascript功能!
首页 > 用户登录界面代码

用户登录界面代码

2018-03-10 18页 doc 53KB 38阅读

用户头像

is_915724

暂无简介

举报
用户登录界面代码用户登录界面代码 系统入口类中这样: LoginFrame lf=new LoginFrame(); lf.setVisible(true); LoginFrame 中,按钮“OK”的监听事件这样: „„//连接数据库,并验证用户名和密码 if(success)//验证成功 MainFrame mf=new MainFrame(); mf.setVisible(true); dispose(); //销毁LoginFrame else 提示错误信息 2 import javax.swing.*; imp...
用户登录界面代码
用户登录界面代码 系统入口类中这样: LoginFrame lf=new LoginFrame(); lf.setVisible(true); LoginFrame 中,按钮“OK”的监听事件这样: „„//连接数据库,并验证用户名和密码 if(success)//验证成功 MainFrame mf=new MainFrame(); mf.setVisible(true); dispose(); //销毁LoginFrame else 提示错误信息 2 import javax.swing.*; import java.awt.*; import java.awt.event.*; //下面代码创建JFrame框架窗体 class FrameTest extends JFrame { public FrameTest() { super("客户登录"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); setSize(406,195); } } //下面代码创建JPanel面板,并将面板添加到框架窗体 class PanelTest extends FrameTest { JPanel panelObj; public PanelTest() { panelObj=new JPanel(); getContentPane().add(panelObj); } } //下面代码创建javax.swing控件,并将控件添加到面板 class ComponentTest extends PanelTest //构造组件类 { JLabel labelName; //姓名 JLabel labelMima; //密码 JTextField textName; //文本框 JTextField textMima; //文本框 JButton buttonObj1; //确定按钮 JButton buttonObj2; //重置按钮 public ComponentTest() { labelName =new JLabel("姓名 "); labelMima =new JLabel("密码 "); textName =new JTextField(25); textMima =new JTextField(15); buttonObj1 =new JButton("确定"); buttonObj2 =new JButton("重置"); buttonObj1.setEnabled(true); //使能 buttonObj2.setEnabled(false); //不使能 panelObj.add(labelName); panelObj.add(textName); panelObj.add(labelMima); panelObj.add(textMima); panelObj.add(buttonObj1); panelObj.add(buttonObj2); } } //下面代码创建GridBagLayout布局管理器,并将布局应用到面板 class LayoutManagerTest extends ComponentTest //构造布局类 { GridBagLayout gbLayoutObj; GridBagConstraints gbcObj; public LayoutManagerTest() { gbLayoutObj=new GridBagLayout(); gbcObj=new GridBagConstraints(); panelObj.setLayout(gbLayoutObj); gbcObj.anchor=GridBagConstraints.EAST; gbcObj.gridx=1; gbcObj.gridy=1; gbLayoutObj.setConstraints(labelName,gbcObj); gbcObj.gridy=2; gbLayoutObj.setConstraints(labelMima,gbcObj); gbcObj.gridy=3; gbLayoutObj.setConstraints(buttonObj1,gbcObj); scalar on the tube for maximum capacity. 0.1mL, 0.2mL, 0.5mL, 1mL, 2mL, 5mL, 10mL and other specifications. For example, 5mL pipette, the maximum capacity is 5.00mL, its scale is 5.00, 4.50, 4.00 ... ... 0; therefore, it can remove any volume of liquid in 0~5mL, precision tube higher than quantity.A Pipette in a horizontal, hands holding turns lotion all wet wall, from catchy poured lotion. Use running water to wash away the remaining lotion, wash several times with distilled water, and finally remove liquid three times, each about 1/4 of the pipette volume. (2) moved liquid operation: will moved liquid tube tip insert was moved take of solution within, right (or left) hand of thumb and the middle finger hold tube neck marking above of place, left (or right) hand took wash ear ball, wash ear ball of tip insert tube neck mouth, and makes its sealed, slowly to let wash ear ball natural recovery undisturbed, until liquid rose to tube neck marking above, quickly moved to wash ear ball, immediately to right hand (or left) index finger press tube neck mouth, left (or right) hand took Sheng put was moved take solution of vessels (beaker, and capacity bottle like), Makes moved liquid tube vertical improve to tube neck marking and sight into level, left took of vessels mouth received in moved liquid tube needle-nosed Xia, right (or left) hand index finger relax or with thumb and the middle finger gently turned moved liquid tube, makes liquid surface slow and smooth to declined, until tuck surface of Crescent surface and marking phase cut, immediately by tight index finger, not let liquid shed; if tip mouth has half drops hold, should in original vessels within wall by off.l'Inclineu més de 10m s'ha d'establir els mecanismes de la desacceleració necessària. (3), la sortida de tub sota les cordes, alçada de pila concretes no hauria de ser més de 1m. D Abocament formigó: (1) abans d'abocar formigó, primer verifica en el suport, plantilla, proves per l'enginyer qualificat abans de l'emplaçament; (2) transport formigó impulsat elevació cub transport (3) formigó abocant de dalt a l'ordre de fons. (4) utilitzar Insereix tipus vibradors vibració libras, lliura de vibració en punts d'abocament i nou abocament de formigó superfície Shang per, vibradors inserir formigó Endoll ràpid seguit lent tirat tenir principis, així com no a produir buida; vibradors a vertical tenen formigó Insereix dins, i per connectar a Qian una capa de formigó, garantia nou abocada de formigó i ara aboca formigó combinat bo, inserir profunditat General per 50 ~ 100mm; espaiat mòbil no ha en radi de paper de dispositiu de vibració de 1,5 vegades vegades i el costat morir espaiat ha de tenir 50 ~ 100mm de distància, Cada vibracions vora acabat fet vibrador lentament per evitar plantilla Tacte vibrador; (5) per a cada part que vibra, el formigó ha de ser vibració compactant fins ara, s'està compactant està marcada per aturar l'enfonsament de formigó, ja no emet bombolles, pis a la superfície, el xarop de Pan; (6) durant el formigó abocar, designat personal comprovar el suport, gbcObj.anchor=GridBagConstraints.WEST; gbcObj.gridx=2; gbcObj.gridy=1; gbLayoutObj.setConstraints(textName,gbcObj); gbcObj.gridy=2; gbLayoutObj.setConstraints(textMima,gbcObj); gbcObj.gridy=3; gbLayoutObj.setConstraints(buttonObj2,gbcObj); } } class EventTest extends LayoutManagerTest { ButtonEvent bEObj; public EventTest() { bEObj=new ButtonEvent(); //创建事件类对象 buttonObj1.addActionListener(bEObj); //注册监听器 buttonObj2.addActionListener(bEObj); //注册监听器 } class ButtonEvent implements ActionListener { public void actionPerformed(ActionEvent e) { Object obj=e.getSource(); Object[] options={" 确定 "," 取消 "}; if(obj==buttonObj1) { String strObj1=textName.getText(); String strObj2=textMima.getText(); String str1=new String("警告~姓名不能为空."); String str2=new String("警告~密码不能为空."); //if(strObj1.length()==0||strObj2.length()==0) // { if(strObj1.length()==0) { //String str1=new String("警告~姓名不能为空."); JOptionPane.showOptionDialog(null,str1,"警告窗口~", JOptionPane.DEFAULT_OPTION,JOptionPane.WARNING_MESSAGE,null,options,o ptions[0]); return; } else { if(strObj2.length()==0) { // String str2=new String("警告~密码不能为空."); JOptionPane.showOptionDialog(null,str2,"警告窗口~", JOptionPane.DEFAULT_OPTION,JOptionPane.WARNING_MESSAGE,null,options,o ptions[0]); return; } // } // } else{ String str3=new String("文本框是:\n姓名:"+strObj1+"\n密码"+strObj2); JOptionPane.showOptionDialog(null,str3,"确定窗口~", JOptionPane.DEFAULT_OPTION,JOptionPane.INFORMATION_MESSAGE,null,optio ns,options[0]); buttonObj1.setEnabled(false); buttonObj2.setEnabled(true); } } } if(obj==buttonObj2) { buttonObj2.setEnabled(false); buttonObj1.setEnabled(true); textName.setText(""); textMima.setText(""); String str1=new String("你单击了\" 重置(E) \",清空文本框。"); JOptionPane.showOptionDialog(null,str1,"信息窗口~", JOptionPane.DEFAULT_OPTION,JOptionPane.INFORMATION_MESSAGE,null,optio ns,options[0]); } } } } //下面代码是包含main()函数的公共类 public class yonghudenglu extends EventTest { public static void main(String[] args) { new yonghudenglu(); } } scalar on the tube for maximum capacity. 0.1mL, 0.2mL, 0.5mL, 1mL, 2mL, 5mL, 10mL and other specifications. For example, 5mL pipette, the maximum capacity is 5.00mL, its scale is 5.00, 4.50, 4.00 ... ... 0; therefore, it can remove any volume of liquid in 0~5mL, precision tube higher than quantity.A Pipette in a horizontal, hands holding turns lotion all wet wall, from catchy poured lotion. Use running water to wash away the remaining lotion, wash several times with distilled water, and finally remove liquid three times, each about 1/4 of the pipette volume. (2) moved liquid operation: will moved liquid tube tip insert was moved take of solution within, right (or left) hand of thumb and the middle finger hold tube neck marking above of place, left (or right) hand took wash ear ball, wash ear ball of tip insert tube neck mouth, and makes its sealed, slowly to let wash ear ball natural recovery undisturbed, until liquid rose to tube neck marking above, quickly moved to wash ear ball, immediately to right hand (or left) index finger press tube neck mouth, left (or right) hand took Sheng put was moved take solution of vessels (beaker, and capacity bottle like), Makes moved liquid tube vertical improve to tube neck marking and sight into level, left took of vessels mouth received in moved liquid tube needle-nosed Xia, right (or left) hand index finger relax or with thumb and the middle finger gently turned moved liquid tube, makes liquid surface slow and smooth to declined, until tuck surface of Crescent surface and marking phase cut, immediately by tight index finger, not let liquid shed; if tip mouth has half drops hold, should in original vessels within wall by off.l'Inclineu més de 10m s'ha d'establir els mecanismes de la desacceleració necessària. (3), la sortida de tub sota les cordes, alçada de pila concretes no hauria de ser més de 1m. D Abocament formigó: (1) abans d'abocar formigó, primer verifica en el suport, plantilla, proves per l'enginyer qualificat abans de l'emplaçament; (2) transport formigó impulsat elevació cub transport (3) formigó abocant de dalt a l'ordre de fons. (4) utilitzar Insereix tipus vibradors vibració libras, lliura de vibració en punts d'abocament i nou abocament de formigó superfície Shang per, vibradors inserir formigó Endoll ràpid seguit lent tirat tenir principis, així com no a produir buida; vibradors a vertical tenen formigó Insereix dins, i per connectar a Qian una capa de formigó, garantia nou abocada de formigó i ara aboca formigó combinat bo, inserir profunditat General per 50 ~ 100mm; espaiat mòbil no ha en radi de paper de dispositiu de vibració de 1,5 vegades vegades i el costat morir espaiat ha de tenir 50 ~ 100mm de distància, Cada vibracions vora acabat fet vibrador lentament per evitar plantilla Tacte vibrador; (5) per a cada part que vibra, el formigó ha de ser vibració compactant fins ara, s'està compactant està marcada per aturar l'enfonsament de formigó, ja no emet bombolles, pis a la superfície, el xarop de Pan; (6) durant el formigó abocar, designat personal comprovar el suport, 3 import java.awt.*; import javax.swing.*; public class guanli_chaozuo extends JFrame{ public JLabel jusername; public JLabel jpassword,jpassword_sure; public JTextField username; public JPasswordField password,password_sure; public JButton jb1,jb2; public void make_GUI(){ jusername=new JLabel("用户名* "); jpassword=new JLabel("新密码* "); jpassword_sure=new JLabel("新密码确认*"); jb1=new JButton("确定"); jb2=new JButton("取消"); username=new JTextField(10); password=new JPasswordField(10); password_sure=new JPasswordField(10); Container cp=getContentPane(); JPanel jp=new JPanel(); JPanel jp2 =new JPanel(); jp.setLayout(new GridLayout(4,8,20,10)); jp.add(jusername);jp.add(username); jp.add(jpassword);jp.add(password); jp.add(jpassword_sure);jp.add(password_sure); jp2.add(jb1); jp2.add(jb2); cp.add(jp,BorderLayout.CENTER); cp.add(jp2,BorderLayout.SOUTH); setSize(300,200); setVisible(true); } public guanli_chaozuo(String s){ super(s); make_GUI(); } public void exit(){ this.dispose(); } 4 import javax.swing.*; import java.awt.*; public class FlowLayoutDemo extends JFrame{ public FlowLayoutDemo(){ setLayout(new BorderLayout(5,5)); setFont(new Font("Helvetica",Font.PLAIN,14)); JLabel jlab1,jlab2,jlab3; jlab1=new JLabel(" 欢迎使用考试系统"); jlab2=new JLabel("用户名:"); jlab3=new JLabel("密码:"); jlab1.setFont(new Font("隶",Font.BOLD,24)); JButton B1=new JButton(); JButton B2=new JButton(); JButton B3=new JButton(); JTextField username=new JTextField(15); JPasswordField password=new JPasswordField (15); B1=new JButton("登陆"); B2=new JButton("注册"); B3=new JButton("取消"); JPanel p1=new JPanel(); JPanel p2=new JPanel(); scalar on the tube for maximum capacity. 0.1mL, 0.2mL, 0.5mL, 1mL, 2mL, 5mL, 10mL and other specifications. For example, 5mL pipette, the maximum capacity is 5.00mL, its scale is 5.00, 4.50, 4.00 ... ... 0; therefore, it can remove any volume of liquid in 0~5mL, precision tube higher than quantity.A Pipette in a horizontal, hands holding turns lotion all wet wall, from catchy poured lotion. Use running water to wash away the remaining lotion, wash several times with distilled water, and finally remove liquid three times, each about 1/4 of the pipette volume. (2) moved liquid operation: will moved liquid tube tip insert was moved take of solution within, right (or left) hand of thumb and the middle finger hold tube neck marking above of place, left (or right) hand took wash ear ball, wash ear ball of tip insert tube neck mouth, and makes its sealed, slowly to let wash ear ball natural recovery undisturbed, until liquid rose to tube neck marking above, quickly moved to wash ear ball, immediately to right hand (or left) index finger press tube neck mouth, left (or right) hand took Sheng put was moved take solution of vessels (beaker, and capacity bottle like), Makes moved liquid tube vertical improve to tube neck marking and sight into level, left took of vessels mouth received in moved liquid tube needle-nosed Xia, right (or left) hand index finger relax or with thumb and the middle finger gently turned moved liquid tube, makes liquid surface slow and smooth to declined, until tuck surface of Crescent surface and marking phase cut, immediately by tight index finger, not let liquid shed; if tip mouth has half drops hold, should in original vessels within wall by off.l'Inclineu més de 10m s'ha d'establir els mecanismes de la desacceleració necessària. (3), la sortida de tub sota les cordes, alçada de pila concretes no hauria de ser més de 1m. D Abocament formigó: (1) abans d'abocar formigó, primer verifica en el suport, plantilla, proves per l'enginyer qualificat abans de l'emplaçament; (2) transport formigó impulsat elevació cub transport (3) formigó abocant de dalt a l'ordre de fons. (4) utilitzar Insereix tipus vibradors vibració libras, lliura de vibració en punts d'abocament i nou abocament de formigó superfície Shang per, vibradors inserir formigó Endoll ràpid seguit lent tirat tenir principis, així com no a produir buida; vibradors a vertical tenen formigó Insereix dins, i per connectar a Qian una capa de formigó, garantia nou abocada de formigó i ara aboca formigó combinat bo, inserir profunditat General per 50 ~ 100mm; espaiat mòbil no ha en radi de paper de dispositiu de vibració de 1,5 vegades vegades i el costat morir espaiat ha de tenir 50 ~ 100mm de distància, Cada vibracions vora acabat fet vibrador lentament per evitar plantilla Tacte vibrador; (5) per a cada part que vibra, el formigó ha de ser vibració compactant fins ara, s'està compactant està marcada per aturar l'enfonsament de formigó, ja no emet bombolles, pis a la superfície, el xarop de Pan; (6) durant el formigó abocar, designat personal comprovar el suport, JPanel p3=new JPanel(); p1.add(jlab2); p1.add(jlab3); p2.add(username); p2.add(password); p3.add(B1); p3.add(B2); p3.add(B3); password.setEchoChar('*'); JTextField flab2; JTextField flab3; add("North", jlab1); add("West",p1); add("Center",p2); add("South",p3); } public static void main(String[] args) { FlowLayoutDemo window=new FlowLayoutDemo(); window.setTitle("用户登陆"); window.setSize(300,200); window.setLocationRelativeTo(null); window.setResizable(false); window.setVisible(true); window.setDefaultCloseOperation(EXIT_ON_CLOSE); } } scalar on the tube for maximum capacity. 0.1mL, 0.2mL, 0.5mL, 1mL, 2mL, 5mL, 10mL and other specifications. For example, 5mL pipette, the maximum capacity is 5.00mL, its scale is 5.00, 4.50, 4.00 ... ... 0; therefore, it can remove any volume of liquid in 0~5mL, precision tube higher than quantity.A Pipette in a horizontal, hands holding turns lotion all wet wall, from catchy poured lotion. Use running water to wash away the remaining lotion, wash several times with distilled water, and finally remove liquid three times, each about 1/4 of the pipette volume. (2) moved liquid operation: will moved liquid tube tip insert was moved take of solution within, right (or left) hand of thumb and the middle finger hold tube neck marking above of place, left (or right) hand took wash ear ball, wash ear ball of tip insert tube neck mouth, and makes its sealed, slowly to let wash ear ball natural recovery undisturbed, until liquid rose to tube neck marking above, quickly moved to wash ear ball, immediately to right hand (or left) index finger press tube neck mouth, left (or right) hand took Sheng put was moved take solution of vessels (beaker, and capacity bottle like), Makes moved liquid tube vertical improve to tube neck marking and sight into level, left took of vessels mouth received in moved liquid tube needle-nosed Xia, right (or left) hand index finger relax or with thumb and the middle finger gently turned moved liquid tube, makes liquid surface slow and smooth to declined, until tuck surface of Crescent surface and marking phase cut, immediately by tight index finger, not let liquid shed; if tip mouth has half drops hold, should in original vessels within wall by off.l'Inclineu més de 10m s'ha d'establir els mecanismes de la desacceleració necessària. (3), la sortida de tub sota les cordes, alçada de pila concretes no hauria de ser més de 1m. D Abocament formigó: (1) abans d'abocar formigó, primer verifica en el suport, plantilla, proves per l'enginyer qualificat abans de l'emplaçament; (2) transport formigó impulsat elevació cub transport (3) formigó abocant de dalt a l'ordre de fons. (4) utilitzar Insereix tipus vibradors vibració libras, lliura de vibració en punts d'abocament i nou abocament de formigó superfície Shang per, vibradors inserir formigó Endoll ràpid seguit lent tirat tenir principis, així com no a produir buida; vibradors a vertical tenen formigó Insereix dins, i per connectar a Qian una capa de formigó, garantia nou abocada de formigó i ara aboca formigó combinat bo, inserir profunditat General per 50 ~ 100mm; espaiat mòbil no ha en radi de paper de dispositiu de vibració de 1,5 vegades vegades i el costat morir espaiat ha de tenir 50 ~ 100mm de distància, Cada vibracions vora acabat fet vibrador lentament per evitar plantilla Tacte vibrador; (5) per a cada part que vibra, el formigó ha de ser vibració compactant fins ara, s'està compactant està marcada per aturar l'enfonsament de formigó, ja no emet bombolles, pis a la superfície, el xarop de Pan; (6) durant el formigó abocar, designat personal comprovar el suport,
/
本文档为【用户登录界面代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索