java学校图书借阅管理系统课程设计报告

发布时间 : 星期四 文章java学校图书借阅管理系统课程设计报告更新完毕开始阅读

Area=new JTextArea(52,50); Area.setBounds(65,80,500,80); add(Area);

setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setVisible(true); repaint(); }

public void actionPerformed(ActionEvent e) {

String x00=x0.getText(); Connection con; Statement sql; ResultSet rs; try{

Class.forName(\ }

catch(ClassNotFoundException e1) { System.out.print(e); } try {

con=DriverManager.getConnection(\ sql=con.createStatement();

rs=sql.executeQuery(\ while(rs.next()) {

Area.append(rs.getString(1)+\ Area.append(rs.getString(2)+\ Area.append(rs.getString(3)+\ Area.append(rs.getString(4)+\ Area.append(rs.getString(5)+\ Area.append(rs.getString(6)+\ Area.append(\ }

con.close(); }

catch(SQLException e2) { System.out.println(e); } } }

BookNO='\

16

4.5 修改图书信息模块设计

截图

17

源代码

class bookxg extends JFrame implements ActionListener {

JLabel j1; JTextField k1;

JButton button44, button55;

JTextField bookNO,bookName,Pub,Date,zuo,Total; bookxg()

{

setTitle(\修改图书信息\ setLocation(20,30); setSize(500,600);

setLayout(null);

j1=new JLabel(\请输入需修改的图书编号:\ add(j1);

j1.setBounds(190,20,160,20); k1=new JTextField(20); add(k1);

k1.setBounds(190,50,150,20); button44=new JButton(\查找\ add(button44);

button44.setBounds(360,50,60,20); button44.addActionListener(this); JLabel j2=new JLabel(\书籍编号:\ add(j2);

j2.setBounds(155,90,60,20); bookNO=new JTextField(10); add(bookNO);

bookNO.setBounds(215,90,150,20); JLabel j3=new JLabel(\书籍名称:\ add(j3);

j3.setBounds(155,130,80,20); bookName=new JTextField(20); add(bookName);

bookName.setBounds(215,130,150,20);

JLabel j4=new JLabel(\出版社名称:\ add(j4);

j4.setBounds(135,170,90,20); Pub=new JTextField(20); add(Pub);

Pub.setBounds(215,170,150,20); JLabel j5=new JLabel(\出版日期:\ add(j5);

18

{

j5.setBounds(155,210,60,20); add(Date);

Date.setBounds(215,210,150,20); JLabel j6=new JLabel(\图书作者:\ add(j6);

j6.setBounds(155,250,60,20); zuo=new JTextField(20); add(zuo);

zuo.setBounds(215,250,150,20); JLabel j7=new JLabel(\书籍总数:\ add(j7);

j7.setBounds(155,290,60,20); Total=new JTextField(20);

Date=new JTextField(20);

add(Total);

Total.setBounds(215,290,150,20); button55=new JButton(\修改\ add(button55);

button55.setBounds(220,335,60,30); button55.addActionListener(this);

setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setVisible(true); }

public void actionPerformed(ActionEvent e)

if(e.getSource()==button44) {

String bookNO0=k1.getText().trim(); Connection con;

Statement stmt; ResultSet rs;

try{ Class.forName(\ con=DriverManager.getConnection(\ stmt=con.createStatement();

rs= stmt.executeQuery(\ if(rs.next()) {

bookNO.setText(rs.getString(1)); bookName.setText(rs.getString(2)); Pub.setText(rs.getString(3)); Date.setText(rs.getString(4)); zuo.setText(rs.getString(5));

BookNO='\

19

联系合同范文客服:xxxxx#qq.com(#替换为@)