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

📄 pnllendnumber_search.java~2~

📁 这是我在北大青鸟的第一学期的一个毕业设计
💻 JAVA~2~
字号:


import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.*;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.sql.ResultSet;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JScrollPane;
import java.sql.*;

public class pnlLendNumber_Search extends JPanel {
    FrmBook fm;
    JLabel jLabel1 = new JLabel();
    JTextField txtCardId = new JTextField();
    JLabel jLabel2 = new JLabel();
    JTextField txtName = new JTextField();
    JButton btnSearch = new JButton();
    JButton btnReset = new JButton();
    public pnlLendNumber_Search(FrmBook f) {
        fm=f;
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.setLayout(null);
        jLabel1.setText("借书证号:");
        jLabel1.setBounds(new Rectangle(22, 17, 60, 32));
        txtCardId.setText("");
        txtCardId.setBounds(new Rectangle(87, 15, 105, 35));
        jLabel2.setText("姓名:");
        jLabel2.setBounds(new Rectangle(221, 18, 50, 33));
        txtName.setText("");
        txtName.setBounds(new Rectangle(284, 15, 105, 35));
        btnSearch.setBounds(new Rectangle(124, 67, 71, 41));
        btnSearch.setText("查找");
        btnSearch.addActionListener(new
                pnlLendNumber_Search_btnSearch_actionAdapter(this));
        btnReset.setBounds(new Rectangle(221, 67, 71, 41));
        btnReset.setText("重置");
        btnReset.addActionListener(new
                                   pnlLendNumber_Search_btnReset_actionAdapter(this));
        this.add(jLabel1);
        this.add(txtCardId);
        this.add(txtName);
        this.add(jLabel2);
        this.add(btnSearch);
        this.add(btnReset);
    }

    public void btnReset_actionPerformed(ActionEvent e) {
        txtCardId.setText("");
        txtName.setText("");
    }

    public void btnSearch_actionPerformed(ActionEvent e) {
        ResultSet rstemp_card=null;
        rstemp_card=clsLendNumber_condb.SearchCard(txtCardId.getText(),txtName.getText());
        try {
            rstemp_card.beforeFirst();
        } catch (SQLException ex) {
        }
       clsLendNumber_condb.initInfo(fm.tblData,rstemp_card);
        String tab="rstemp_card";
        fm.DataPane(rstemp_card,tab);

    }
}


class pnlLendNumber_Search_btnSearch_actionAdapter implements ActionListener {
    private pnlLendNumber_Search adaptee;
    pnlLendNumber_Search_btnSearch_actionAdapter(pnlLendNumber_Search adaptee) {
        this.adaptee = adaptee;
    }

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


class pnlLendNumber_Search_btnReset_actionAdapter implements ActionListener {
    private pnlLendNumber_Search adaptee;
    pnlLendNumber_Search_btnReset_actionAdapter(pnlLendNumber_Search adaptee) {
        this.adaptee = adaptee;
    }

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

⌨️ 快捷键说明

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