📄 pnllendbook_lend.java~1~
字号:
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_Lend extends JPanel {
FrmBook fm;
public pnlLendBook_Lend(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(26, 19, 68, 35));
txtCardId.setBounds(new Rectangle(88, 18, 119, 31));
jLabel2.setText("图书编号:");
jLabel2.setBounds(new Rectangle(231, 17, 62, 35));
txtBookNumber.setBounds(new Rectangle(290, 19, 119, 31));
btnLend.setBounds(new Rectangle(89, 69, 76, 43));
btnLend.setText("借书");
btnLend.addActionListener(new pnlLendBook_Lend_btnLend_actionAdapter(this));
btnReset.setBounds(new Rectangle(225, 69, 76, 43));
btnReset.setText("重置");
btnReset.addActionListener(new pnlLendBook_Lend_btnReset_actionAdapter(this));
this.add(jLabel1);
this.add(jLabel2);
this.add(txtCardId);
this.add(txtBookNumber);
this.add(btnLend);
this.add(btnReset);
}
JLabel jLabel1 = new JLabel();
JTextField txtCardId = new JTextField();
JLabel jLabel2 = new JLabel();
JTextField txtBookNumber = new JTextField();
JButton btnLend = new JButton();
JButton btnReset = new JButton();
public void btnReset_actionPerformed(ActionEvent e) {
txtCardId.setText("");
txtBookNumber.setText("");
}
public void btnLend_actionPerformed(ActionEvent e) {
boolean book=false,card=false;
card=clsLendNumber_condb.IsCanLend(txtCardId.getText());
book=bookadd_condb.IsHaveBook(txtBookNumber.getText());
if(card && book)
{
clsLendBook_condb.InsertRecord(txtCardId.getText(),txtBookNumber.getText());
clsLendNumber_condb.SetLendCount(txtCardId.getText());
bookadd_condb.SetZero(txtBookNumber.getText());
}
clsLendBook_condb.initSearch();
clsLendBook_condb.initInfo(fm.tblData,clsLendBook_condb.rsLb);
JScrollPane ps=new JScrollPane();
JPanel p=new JPanel();
ps.add(p);
p.add(fm.jTableHeader1);
p.add(fm.tblData);
fm.spnV.setBottomComponent(p);
}
}
class pnlLendBook_Lend_btnLend_actionAdapter implements ActionListener {
private pnlLendBook_Lend adaptee;
pnlLendBook_Lend_btnLend_actionAdapter(pnlLendBook_Lend adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.btnLend_actionPerformed(e);
}
}
class pnlLendBook_Lend_btnReset_actionAdapter implements ActionListener {
private pnlLendBook_Lend adaptee;
pnlLendBook_Lend_btnReset_actionAdapter(pnlLendBook_Lend adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.btnReset_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -