资源描述:
《简单的java图书馆管理系统》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、课程设计题目图书馆管理系统一、设计环境DBMS:mysql开发工具:eclipse应用程序开发环境:win8.1系统运行环境:win8.1二、概要设计(1)功能:1.创建图书馆界面(凭账号密码登陆)2.对数据库进行图书的查找、修改、添加、删除3.实时显示图书馆数据的改变(2)E—R图(3)流程图(4)表(5)数据(5)连接数据库代码Connectionconn=null;Class.forName("com.mysql.jdbc.Driver");conn=DriverManager.getConnection(
2、"jdbc:mysql://localhost:3306/test","root","panda1993");四、详细设计(1)主界面Login.javaimportjava.awt.BorderLayout;importjava.awt.Color;importjava.awt.Container;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.sql.Connection;importjava.sq
3、l.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjavax.swing.ImageIcon;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JOptionPane;importjavax.swing.JPanel;import
4、javax.swing.JPasswordField;importjavax.swing.JTextField;publicclassLoginextendsJFrame{privatestaticfinallongserialVersionUID=1L;//保持兼容privateJLabeljlUsername;privateJLabeljlPwd;privateJTextFieldtxtUsername;//用户名privateJTextFieldtxtPassword;//密码privateJButtonj
5、bOk;privateJButtonjbCancel;publicJLabelgetJlUsername(){if(jlUsername==null){jlUsername=newJLabel("账号");jlUsername.setForeground(Color.black);jlUsername.setBounds(118,40,85,30);}returnjlUsername;}publicJLabelgetJlPwd(){if(jlPwd==null){jlPwd=newJLabel("密码");jlP
6、wd.setForeground(Color.LIGHT_GRAY);jlPwd.setBounds(118,100,85,30);}returnjlPwd;}publicJTextFieldgetTxtUsername(){if(txtUsername==null){txtUsername=newJTextField(20);txtUsername.setBounds(180,40,200,30);}returntxtUsername;}publicJTextFieldgetTxtPassword(){if(t
7、xtPassword==null){txtPassword=newJPasswordField(20);txtPassword.setBounds(180,100,200,30);}returntxtPassword;}publicJButtongetJbOk(){if(jbOk==null){jbOk=newJButton("登陆");jbOk.setBounds(150,180,90,30);//jbOk.addActionListener(this);}returnjbOk;}publicJButtonge
8、tJbCancel(){if(jbCancel==null){jbCancel=newJButton("取消");jbCancel.setBounds(300,180,90,30);}returnjbCancel;}publicLogin(Stringtitle){super(title);//JFrameframe=newJFrame();Containercantai