📄 himslogin.java~13~
字号:
package com.dba;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class HIMSLogIn { JPanel jPanel1 = new JPanel(); JLabel jLabel1 = new JLabel(); XYLayout xYLayout1 = new XYLayout(); JLabel jLabel2 = new JLabel(); JLabel jLabel3 = new JLabel(); JTextField jTextField1 = new JTextField(); JPasswordField jPasswordField1 = new JPasswordField(); JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); public HIMSLogIn() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { jLabel1.setFont(new java.awt.Font("SansSerif", 1, 20)); jLabel1.setForeground(Color.black); jLabel1.setDebugGraphicsOptions(0); jLabel1.setText("宾馆管理系统登录"); jPanel1.setLayout(xYLayout1); jLabel2.setFont(new java.awt.Font("Dialog", 1, 15)); jLabel2.setHorizontalAlignment(SwingConstants.CENTER); jLabel2.setText("管理员"); jLabel3.setFont(new java.awt.Font("Dialog", 1, 15)); jLabel3.setDisplayedMnemonic('0'); jLabel3.setHorizontalAlignment(SwingConstants.CENTER); jLabel3.setText("密码"); jPasswordField1.addActionListener(new HIMSLogIn_jButton2_actionAdapter(this)); jButton1.setFont(new java.awt.Font("Dialog", 1, 15)); jButton1.setForeground(Color.black); jButton1.setText("登录"); jButton1.addActionListener(new HIMSLogIn_jButton1_actionAdapter(this)); jPanel1.setOpaque(true); jPanel1.setPreferredSize(new Dimension(284, 272)); jButton2.setFont(new java.awt.Font("SansSerif", 1, 15)); jButton2.setForeground(Color.black); jButton2.setText("重置"); jButton2.addActionListener(new HIMSLogIn_jButton2_actionAdapter(this)); jTextField1.setText(""); jPasswordField1.setText(""); jPanel1.add(jLabel1, new XYConstraints(115, 5, -1, -1)); jPanel1.add(jLabel2, new XYConstraints(30, 80, 70, 45)); jPanel1.add(jLabel3, new XYConstraints(30, 165, 59, 45)); jPanel1.add(jTextField1, new XYConstraints(135, 80, 135, 42)); jPanel1.add(jPasswordField1, new XYConstraints(135, 165, 135, 42)); jPanel1.add(jButton1, new XYConstraints(86, 250, 95, 30)); jPanel1.add(jButton2, new XYConstraints(231, 250, 95, 30)); } void jButton1_actionPerformed(ActionEvent e) {//登录 String getname=jTextField1.getText(); String getpassword=jPasswordField1.getPassword().toString(); if(logIn(getname,getpassword)){//如果输入正确 }else{//否则 } } void jButton2_actionPerformed(ActionEvent e) {//重置 jTextField1.setText(""); jPasswordField1.setText(""); } void jPasswordField1_actionPerformed(ActionEvent e) { } public boolean logIn(String name,String password){// if(true) return true; else return false; }}//end public classclass HIMSLogIn_jButton1_actionAdapter implements java.awt.event.ActionListener { HIMSLogIn adaptee; HIMSLogIn_jButton1_actionAdapter(HIMSLogIn adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); }}class HIMSLogIn_jButton2_actionAdapter implements java.awt.event.ActionListener { HIMSLogIn adaptee; HIMSLogIn_jButton2_actionAdapter(HIMSLogIn adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton2_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -