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

📄 pnllendbook_return.java

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


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.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JScrollPane;

public class pnlLendBook_Return extends JPanel {
    FrmBook fm;
    public pnlLendBook_Return(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(20, 17, 69, 34));
        txtCardId.setText("");
        txtCardId.setBounds(new Rectangle(80, 16, 116, 32));
        jLabel2.setText("图书编号:");
        jLabel2.setBounds(new Rectangle(223, 15, 69, 37));
        txtBookId.setText("");
        txtBookId.setBounds(new Rectangle(293, 16, 116, 32));
        btnReturn.setBounds(new Rectangle(81, 63, 82, 45));
        btnReturn.setText("还书");
        btnReturn.addActionListener(new
                                    pnlLendBook_Return_btnReturn_actionAdapter(this));
        btnReset.setBounds(new Rectangle(211, 63, 82, 45));
        btnReset.setText("重置");
        btnReset.addActionListener(new
                                   pnlLendBook_Return_btnReset_actionAdapter(this));
        this.add(jLabel1);
        this.add(txtCardId);
        this.add(txtBookId);
        this.add(jLabel2);
        this.add(btnReturn);
        this.add(btnReset);
    }

    JLabel jLabel1 = new JLabel();
    JTextField txtCardId = new JTextField();
    JLabel jLabel2 = new JLabel();
    JTextField txtBookId = new JTextField();
    JButton btnReturn = new JButton();
    JButton btnReset = new JButton();
    public void btnReset_actionPerformed(ActionEvent e) {
        txtCardId.setText("");
        txtBookId.setText("");
    }

    public void btnReturn_actionPerformed(ActionEvent e) {


        boolean b;
        b=clsLendBook_condb.ReturnBook(txtCardId.getText(),txtBookId.getText());
        if(b)
        {
            bookadd_condb.SetOne(txtBookId.getText());
            clsLendNumber_condb.SetReLendCount(txtCardId.getText());
        }

        clsLendBook_condb.initSearch_return();
        clsLendBook_condb.initInfo(fm.tblData,clsLendBook_condb.rsLbr);
        fm.page=0;
       String tab="returnbook";
        fm.DataPane(clsLendBook_condb.rsLend(),tab);

    }
}


class pnlLendBook_Return_btnReturn_actionAdapter implements ActionListener {
    private pnlLendBook_Return adaptee;
    pnlLendBook_Return_btnReturn_actionAdapter(pnlLendBook_Return adaptee) {
        this.adaptee = adaptee;
    }

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


class pnlLendBook_Return_btnReset_actionAdapter implements ActionListener {
    private pnlLendBook_Return adaptee;
    pnlLendBook_Return_btnReset_actionAdapter(pnlLendBook_Return adaptee) {
        this.adaptee = adaptee;
    }

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

⌨️ 快捷键说明

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