基于java的图书管理系统源代码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

声明:本系统是基于C/S的图书管理系统,主要使用的是Oracle数据库,下面附所有实现代码

package library;

import java.awt.BorderLayout;

import java.awt.Container;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.sql.ResultSet;

import javax.swing.JButton;

import javax.swing.JComboBox;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JTextField;

public class book_add extends JFrame implements ActionListener{ DataBaseManager db=new DataBaseManager();

ResultSet rs;

JPanel panel1,panel2;

JLabel book_id_label,book_name_label,author_label,

press_label,press_date_label,price_label,book_num_label,borrow ed_num_label,address;

JTextField

book_id_TextField,book_name_TextField,author_TextField,

press_TextField,press_date_TextField,price_TextField,book_num_ TextField,

borrowed_count;

JComboBox addresst;

Container c;

JButton clear,add,exit;

public book_add()

{

super("添加图书信息");

c=getContentPane();

c.setLayout(new BorderLayout());

book_id_label=new JLabel("编号",JLabel.CENTER);

book_name_label=new JLabel("名称",JLabel.CENTER);

author_label=new JLabel("作者",JLabel.CENTER);

press_label=new JLabel("出版社",JLabel.CENTER);

press_date_label=new JLabel("出版日期",JLabel.CENTER);

price_label=new JLabel("价格",JLabel.CENTER);

book_num_label=new JLabel("库存数",JLabel.CENTER);

borrowed_num_label=new JLabel("已借阅数",JLabel.CENTER);

address=new JLabel("藏书地址",JLabel.CENTER);

book_id_TextField=new JTextField(15);

book_name_TextField=new JTextField(15);

author_TextField=new JTextField(15);

press_TextField=new JTextField(15);

press_date_TextField=new JTextField(15);

price_TextField=new JTextField(15);

book_num_TextField=new JTextField(15);

borrowed_count=new JTextField(15);

borrowed_count.setText("0");

addresst=new JComboBox();

addresst.addItem("扬子津图书馆");

addresst.addItem("荷花池图书馆");

addresst.addItem("瘦西湖图书馆");

addresst.addItem("淮海路图书馆");

panel1=new JPanel();

panel1.setLayout(new GridLayout(9,2));

panel1.add(book_id_label);

panel1.add(book_id_TextField);

panel1.add(book_name_label);

panel1.add(book_name_TextField);

panel1.add(press_label);

panel1.add(press_TextField);

panel1.add(author_label);

panel1.add(author_TextField);

panel1.add(press_date_label);

panel1.add(press_date_TextField);

panel1.add(price_label);

panel1.add(price_TextField);

panel1.add(book_num_label);

panel1.add(book_num_TextField);

panel1.add(borrowed_num_label);

panel1.add(borrowed_count);

panel1.add(address);

panel1.add(addresst);

panel2=new JPanel();

相关文档
最新文档