⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loginframe1.java~75~

📁 该文件中包含有源代码及一部分的文档,该系统是一个小型的英语单词字典的系统.
💻 JAVA~75~
字号:
package logindemo;

import javax.swing.event.*;
import java.awt.*;
import com.borland.jbcl.layout.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;


/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
//登入界面
public class LoginFrame1 extends JFrame {
    JPanel contentPane;
    JPanel jPanel1 = new JPanel();
    JPanel jPanel2 = new JPanel();
    JPanel jPanel3 = new JPanel();
    JButton jButton1 = new JButton(
            "<html><center><b><font color=#0000ff>图书管理员</font></html>");//图书管理员身份
    JButton jButton2 = new JButton(
            "<html><center><b><font color=#0000ff>读者</font></html>");//读者身份
    FlowLayout flowLayout1 = new FlowLayout();
    FlowLayout flowLayout2 = new FlowLayout();
    JLabel jLabel1 = new JLabel("欢迎进入图书查询系统");


    public LoginFrame1() {
        try {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    /**
     * Component initialization.
     *
     * @throws java.lang.Exception
     */
    private void jbInit() throws Exception {
        contentPane = (JPanel) getContentPane();
        contentPane.setLayout(flowLayout2);
        setSize(new Dimension(436, 415));
        setTitle("欢迎进入图书查询系统");
        jPanel1.setLayout(new BoxLayout(jPanel1, BoxLayout.PAGE_AXIS));
        jButton1.addActionListener(new LoginFrame1_jButton1_actionAdapter(this));
        jButton2.addActionListener(new LoginFrame1_jButton2_actionAdapter(this));
        contentPane.add(Box.createRigidArea(new Dimension(100,100)));
        jLabel1.setBackground(SystemColor.control);
        jLabel1.setFont(new java.awt.Font("楷体_GB2312", Font.PLAIN, 50));
        jButton1.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jButton2.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jPanel2.setBackground(SystemColor.control);
        jPanel1.setBackground(SystemColor.controlHighlight);
        jPanel2.add(jButton2);
        jPanel2.add(jButton1);
        jPanel1.add(jLabel1);
        jPanel1.add(jPanel2, null);
        contentPane.add(jPanel1, null);
    }


    public void jButton1_actionPerformed(ActionEvent e) {
         this.setVisible(true);
         MainDemoUserframe1 mf = new MainDemoUserframe1();
         mf.setVisible(true);
         if {
                 jButton1.setEnabled(false);
    }

    public void jButton2_actionPerformed(ActionEvent e) {
         this.setVisible(true);
         MainDemoframe1 mdf = new MainDemoframe1();
         mdf.setVisible(true);
    }

}


class LoginFrame1_jButton1_actionAdapter implements ActionListener {
    private LoginFrame1 adaptee;
    LoginFrame1_jButton1_actionAdapter(LoginFrame1 adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
    }
}


class LoginFrame1_jButton2_actionAdapter implements ActionListener {
    private LoginFrame1 adaptee;
    LoginFrame1_jButton2_actionAdapter(LoginFrame1 adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton2_actionPerformed(e);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -