当前位置:首页 > java学校图书借阅管理系统课程设计报告
4.3 新书入库模块设计
截图
源代码
class newbook extends JFrame implements ActionListener { {
setTitle(\新书入库\setLayout(null); setVisible(true); newbook()
JLabel f1,f2,f3,f4,f5,f6; JTextField t1,t2,t3,t4,t5,t6; JRadioButton radio1,radio2; ButtonGroup group1; JComboBox com; JButton Button1;
setBounds(50,50,300,400);
12
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f1=new JLabel(\图书编号:\f1.setBounds(20,20,100,20); f2=new JLabel(\图书名称:\f2.setBounds(20,50,100,20); f3=new JLabel(\出版社名称:\f3.setBounds(20,80,100,20); f4=new JLabel(\图书出版日期:\f4.setBounds(20,110,100,20); f5=new JLabel(\图书作者:\ f5.setBounds(20,140,100,20); f6=new JLabel(\图书入库总数:\f6.setBounds(20,170,100,20); t1=new JTextField(20); t1.setBounds(100,20,120,20); t2=new JTextField(20); t2.setBounds(100,50,120,20); t3=new JTextField(20); t3.setBounds(100,80,120,20); t4=new JTextField(20);
t4.setBounds(100,110,120,20); t5=new JTextField(20);
t5.setBounds(100,140,120,20); t6=new JTextField(20);
t6.setBounds(100,170,120,20); Button1=new JButton(\入库登记\Button1.addActionListener(this); Button1.setBounds(100,200,100,20); add(f1); add(t1); add(f2); add(t2); add(f3); add(t3); add(f4); add(t4); add(f5); add(t5); add(f6); add(t6); add(Button1); }
13
JOptionPane.showMessageDialog(this, \入库成功!\消息对话\WARNING_MESSAGE);
this.setVisible(false); }
try{Class.forName(\Connection
Statement stmt=con.createStatement(); String sql=\stmt.executeUpdate(sql); con.close();}
catch(Exception e1){ System.out.print(e1);}
public void actionPerformed(ActionEvent e) {String t11=t1.getText(); String t22=t2.getText(); String t33=t3.getText(); String t44=t4.getText(); String t55=t5.getText(); String t66=t6.getText();
con=DriverManager.getConnection(\
values('\
}
14
4.4 图书查询模块设计
截图
源代码
class bookcx extends JFrame implements ActionListener {
JLabel z0; JTextField x0; JButton button22; JTextArea Area; bookcx()
{
setTitle(\图书查询\
setLocation(20,30);
setLayout(null);
z0=new JLabel(\请输入您要查询的图书编号:\ z0.setBounds(100,20,160,20);
setSize(700,400);
add(z0);
x0=new JTextField(20);
x0.setBounds(270,20,80,20); add(x0);
button22=new JButton(\查询\
button22.setBounds(370,20,60,20); add(button22);
button22.addActionListener(this);
15
共分享92篇相关文档