开发工具:
文件大小: 1mb
下载次数: 0
上传时间: 2009-02-13
详细说明: 登陆的代码如下 package denglu; import java.awt.Color; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.plaf.basic.BasicButtonUI; import com.swtdesigner.SwingResourceManager; public class Deng Lu extends JFrame{ private JPasswordField pass; private static JTextField name; public void DengLu() { this.setTitle("登入窗口"); //设置登入窗口的属性参数 getContentPane().setLayout(null); setSize(453, 317); final JLabel label = new JLabel(); label.setHorizontalAlignment(SwingConstants.CENTER); label.setForeground(new Color(128, 128, 0)); label.setFont(new Font("华文彩云", Font.BOLD, 48)); label.setText("学生管理系统"); label.setBounds(0, 0, 447, 77); getContentPane().add(label); final JLabel label_1 = new JLabel(); label_1.setForeground(new Color(128, 128, 0)); label_1.setFont(new Font("", Font.BOLD, 22)); label_1.setText("用 户 名:"); label_1.setBounds(56, 101, 122, 32); getContentPane().add(label_1); final JLabel label_1_1 = new JLabel(); label_1_1.setForeground(new Color(255, 255, 255)); label_1_1.setFont(new Font("", Font.BOLD, 22)); label_1_1.setText("密 码:"); label_1_1.setBounds(56, 154, 122, 32); getContentPane().add(label_1_1); name = new JTextField();//用户名输入框 name.setBounds(205, 105, 155, 32); getContentPane().add(name); pass = new JPasswordField();//密码输入框 pass.setBounds(205, 158, 155, 32); pass.addKeyListener(new Key());//添加键盘监听 getContentPane().add(pass); final JButton button_1 = new JButton(); button_1.setForeground(new Color(255, 255, 255)); //设置按钮的事件处理 button_1.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { /*String str = pass.getText(); try { MessageDigest md = MessageDigest.getInstance("MD5"); //进行加密 byte s[] = md.digest(str.getBytes()); //获取加密后的密码 String strn = new String(s); } catch (NoSuchAlgorithmException e) { // TODO Auto-generated catch block e.printStackTrace(); }*/ Compare co = new Compare(); co.DuiBi(name.getText(), pass.getText()); DengLu.this.dispose(); } }); button_1.setText("确定"); button_1.setBounds(83, 226, 95, 32); button_1.setIcon(new ImageIcon("d:\\我的文档\\桌面\\asd\\25.gif")); button_1.setBorder(null); button_1.setBorderPainted(false); button_1.setOpaque(false); button_1.setRolloverEnabled(true); button_1.setUI(new BasicButtonUI()); button_1.setIconTextGap(-60); button_1.setFont(new Font("黑体", Font.PLAIN, 16)); getContentPane().add(button_1); DengLu.this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setResizable(false); this.setLocation(400, 200); this.setVisible(true); final JButton button_1_1 = new JButton(); button_1_1.setForeground(new Color(255, 255, 255)); button_1_1.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { new xiugai(); DengLu.this.dispose(); } }); button_1_1.setIcon(new ImageIcon("d:\\我的文档\\桌面\\asd\\25.gif")); button_1_1.setBorder(null); button_1_1.setBorderPainted(false); button_1_1.setOpaque(false); button_1_1.setRolloverEnabled(true); button_1_1.setUI(new BasicButtonUI()); button_1_1.setText("修改密码"); button_1_1.setFont(new Font("黑体", Font.BOLD, 15)); button_1_1.setIconTextGap(-68); button_1_1.setBounds(244, 225, 122, 32); getContentPane().add(button_1_1); final JLabel label_2 = new JLabel(); label_2.setIcon(SwingResourceManager.getIcon(DengLu.class, "/picture/登.JPG")); label_2.setText("New JLabel"); label_2.setBounds(0, 0, 447, 287); getContentPane().add(label_2); setIconImage(SwingResourceManager.getImage(DengLu.class, "/picture/登.JPG")); } //对外提供用户名方便其做判断 public String getName(){ return name.getText(); } public static void main(String[] args) { // TODO Auto-generated method stub new DengLu().DengLu(); //new ZhuCe(); } //设置键盘监听的处理 public class Key extends KeyAdapter{ public void keyPressed(KeyEvent e) { int code = e.getKeyCode(); if(code == KeyEvent.VK_ENTER) { Compare co = new Compare(); co.DuiBi(name.getText(), pass.getText()); DengLu.this.dispose(); } } } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.