图书馆管理系统文档格式.docx

上传人:b****6 文档编号:20174646 上传时间:2023-01-17 格式:DOCX 页数:33 大小:21.63KB
下载 相关 举报
图书馆管理系统文档格式.docx_第1页
第1页 / 共33页
图书馆管理系统文档格式.docx_第2页
第2页 / 共33页
图书馆管理系统文档格式.docx_第3页
第3页 / 共33页
图书馆管理系统文档格式.docx_第4页
第4页 / 共33页
图书馆管理系统文档格式.docx_第5页
第5页 / 共33页
点击查看更多>>
下载资源
资源描述

图书馆管理系统文档格式.docx

《图书馆管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《图书馆管理系统文档格式.docx(33页珍藏版)》请在冰豆网上搜索。

图书馆管理系统文档格式.docx

,Font.BOLD,14);

publicBookAddFrame()

{

this.setTitle("

添加书籍"

);

this.setSize(400,600);

this.setLayout(null);

this.setResizable(false);

this.setVisible(true);

this.addCompnents();

this.add(getbookName());

this.add(getbookNo());

this.add(getbookPress());

this.add(getbookPrice());

this.add(getbookWriter());

this.add(getbookPosition());

this.add(getbookRemain());

}

privatevoidaddCompnents()

bookNameLabel=newJLabel("

书名:

"

bookNameLabel.setFont(font);

bookNameLabel.setBounds(100,10,60,20);

this.add(bookNameLabel);

bookNoLabel=newJLabel("

书号:

bookNoLabel.setFont(font);

bookNoLabel.setBounds(100,50,60,20);

this.add(bookNoLabel);

bookPressLabel=newJLabel("

出版社:

bookPressLabel.setFont(font);

bookPressLabel.setBounds(100,90,60,20);

this.add(bookPressLabel);

bookPriceLabel=newJLabel("

价格:

bookPriceLabel.setFont(font);

bookPriceLabel.setBounds(100,130,60,20);

this.add(bookPriceLabel);

bookWriterLabel=newJLabel("

作者:

bookWriterLabel.setFont(font);

bookWriterLabel.setBounds(100,170,60,20);

this.add(bookWriterLabel);

bookPositionLabel=newJLabel("

位置:

bookPositionLabel.setFont(font);

bookPositionLabel.setBounds(100,210,60,20);

this.add(bookPositionLabel);

bookRemainLabel=newJLabel("

进货量:

bookRemainLabel.setFont(font);

bookRemainLabel.setBounds(100,250,60,20);

this.add(bookRemainLabel);

YesBtn=newJButton("

确定"

YesBtn.setFont(font);

YesBtn.setBounds(130,300,80,30);

this.add(YesBtn);

NoBtn=newJButton("

取消"

NoBtn.setFont(font);

NoBtn.setBounds(220,300,80,30);

this.add(NoBtn);

YesBtn.addActionListener(newActionListener()//添加确认按钮响应

{

@Override

publicvoidactionPerformed(ActionEvente)

{

//TODO自动生成的方法存根

Stringsql="

insertintoBook(bookNo,bookName,bookPress,bookPrice,bookWriter,bookPosition,bookRemain)values("

+bookNo.getText()+"

'

+bookName.getText()+"

'

+bookPress.getText()+"

"

+bookPrice.getText()+"

+bookWriter.getText()+"

+bookPosition.getText()+"

+bookRemain.getText()+"

;

try{

myCon.getStatement().executeUpdate(sql);

myCon.breakDB();

}catch(SQLExceptione1){

e1.printStackTrace();

}

MFrameframe=newMFrame();

dispose();

}

});

NoBtn.addActionListener(newActionListener()

@Override

publicvoidactionPerformed(ActionEvente){

//TODO自动生成的方法存根

MFrameframe=newMFrame();

dispose();

});

publicstaticJTextFieldgetbookName()

if(bookName==null){

bookName=newJTextField();

bookName.setBounds(155,10,150,20);

bookName.setFont(font);

bookName.setForeground(Color.blue);

}

returnbookName;

publicstaticJTextFieldgetbookNo()

if(bookNo==null)

bookNo=newJTextField();

bookNo.setFont(font);

bookNo.setBounds(155,50,150,20);

bookNo.setForeground(Color.blue);

returnbookNo;

publicstaticJTextFieldgetbookPress()

if(bookPress==null)

bookPress=newJTextField();

bookPress.setFont(font);

bookPress.setBounds(155,90,150,20);

bookPress.setForeground(Color.blue);

returnbookPress;

publicstaticJTextFieldgetbookPrice()

if(bookPrice==null)

bookPrice=newJTextField();

bookPrice.setFont(font);

bookPrice.setBounds(155,130,150,20);

bookPrice.setForeground(Color.blue);

returnbookPrice;

publicstaticJTextFieldgetbookWriter()

if(bookWriter==null)

bookWriter=newJTextField();

bookWriter.setFont(font);

bookWriter.setBounds(155,170,150,20);

bookWriter.setForeground(Color.blue);

returnbookWriter;

publicstaticJTextFieldgetbookPosition()

if(bookPosition==null)

bookPosition=newJTextField();

bookPosition.setFont(font);

bookPosition.setBounds(155,210,150,20);

bookPosition.setForeground(Color.blue);

returnbookPosition;

publicstaticJTextFieldgetbookRemain()

if(bookRemain==null)

bookRemain=newJTextField();

bookRemain.setFont(font);

bookRemain.setBounds(155,250,150,20);

bookRemain.setForeground(Color.blue);

returnbookRemain;

//publicvoidsetFrame(LoginFrameframe){

//this.frame1=frame;

//}

}

importjava.sql.ResultSet;

classBookSERFrameextendsJFrame//修改书籍

privatestaticJTextFieldbookName,bookNo,bookPress,bookPrice,bookWriter,bookPosition,bookRemain;

privateJLabelbookNameLabel,bookNoLabel,bookPressLabel,bookPriceLabel,bookWriterLabel,bookPositionLabel,bookRemainLabel;

publicBookSERFrame()

修改书籍"

bookNoLabel.setBounds(100,10,60,20);

bookNameLabel.setBounds(100,120,60,20);

bookPressLabel.setBounds(95,160,60,20);

bookPriceLabel.setBounds(100,200,60,20);

bookWriterLabel.setBounds(100,240,60,20);

bookPositionLabel.setBounds(100,280,60,20);

库存:

bookRemainLabel.setBounds(100,320,60,20);

YesBtn.setBounds(130,50,80,30);

NoBtn.setBounds(220,50,80,30);

//bookName,bookNo,bookPress,bookPrice,bookWriter,bookPosition,bookRemain

Stringsql="

select*fromBookwherebookNo="

+bookNo.getText()+"

try{

myCon.getStatement().executeUpdate(sql);

myCon.breakDB();

}catch(SQLExceptione1){

e1.printStackTrace();

}

}

bookNo.setBounds(150,10,150,20);

bookName.setBounds(150,120,150,20);

bookPress.setBounds(150,160,150,20);

bookPrice.setBounds(150,200,150,20);

bookWriter.setBounds(150,240,150,20);

bookPosition.setBounds(150,280,150,20);

bookRemain.setBounds(150,320,150,20);

importjava.sql.PreparedStat

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 工作范文 > 行政公文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1