JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx

上传人:b****6 文档编号:19398669 上传时间:2023-01-05 格式:DOCX 页数:49 大小:27.20KB
下载 相关 举报
JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx_第1页
第1页 / 共49页
JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx_第2页
第2页 / 共49页
JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx_第3页
第3页 / 共49页
JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx_第4页
第4页 / 共49页
JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx_第5页
第5页 / 共49页
点击查看更多>>
下载资源
资源描述

JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx

《JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx(49页珍藏版)》请在冰豆网上搜索。

JAVA课程设计基于UI的图书管理系统Word格式文档下载.docx

Stringbookname;

Stringbookid;

Stringauthor;

Stringpublisher;

Stringname;

intcount;

JTextFieldtest;

JTextFieldtest1;

JLabeljLabel;

JPaneljpane;

intresult=0;

publicAccess(Stringusername,Stringpassword){

this.username=username;

this.password=password;

try{

Class.forName();

Stringstrurl="

jdbc:

odbc:

driver={MicrosoftAccessDriver(*.mdb)};

DBQ=D:

\\workspace\\bookmis.mdb"

;

conn=DriverManager.getConnection(strurl);

stmt=conn.createStatement();

}catch(Exceptione){

}

}

publicAccess(Stringbookname,Stringbookid,Stringauthor,Stringpublisher,JTextFieldtest){

this.bookname=bookname;

this.bookid=bookid;

this.author=author;

this.publisher=publisher;

this.test=test;

publicAccess(Stringbookname,Stringbookid,Stringauthor,Stringpublisher,JLabeljlabel){

this.jLabel=jlabel;

publicAccess(){

publicAccess(Stringtemp,JTextFieldtest1){

this.temp=temp;

this.test1=test1;

publicAccess(Stringaname,JPaneljpane,JLabeljLabel){

name=aname;

this.jpane=jpane;

this.jLabel=jLabel;

publicAccess(Stringaname,JLabeljLabel){

publicvoidregsdit(){

result=stmt.executeUpdate("

insertintouserinform(username,password)values('

"

+username+"

'

'

+password+"

)"

);

}catch(SQLExceptione){

//TODO自动生成catch块

newFail().getJDialog();

if(result==1){

MainMenumainmenu=newMainMenu();

mainmenu.getJFrame();

}else{

publicvoidlogin(){

rs=stmt.executeQuery("

select*fromuserinformwhereusername='

andpassword='

if(rs.next())

{

MainClmaincl=newMainCl();

maincl.getJFrame();

}

else{

LoginFailloginfail=newLoginFail();

loginfail.getJDialog();

e.printStackTrace();

publicvoidinsert(){

insertintobookmis(bookname,num,auther,publisher)values('

+bookname+"

+bookid+"

+author+"

+publisher+"

if(result==1){

test.setText("

插入成功"

elsetest.setText("

插入失败"

publicvoidlook(){

Lookalook=newLook();

try{

rs=stmt.executeQuery("

select*frombookmis"

while(rs.next())

{

bookname=rs.getString("

bookname"

bookid=rs.getString("

num"

author=rs.getString("

auther"

publisher=rs.getString("

publisher"

count=rs.getInt("

count"

Stringacount=Integer.toString(count);

Stringtemp="

书名:

"

编号:

作者:

出版社:

数量:

+acount;

alook.getList().add(temp);

alook.getJFrame();

alook.getList().add("

\n\n\n\n"

}catch(Exceptione){

}

publicvoiddelete(){

try{result=0;

deletefrombookmiswherebookname='

+temp+"

}catch(Exceptione){

if(result==1){

test1.setText("

删除成功"

elsetest1.setText("

删除失败,你输入的书名有误"

publicvoidupdate(){

rs=stmt.executeQuery("

select*frombookmiswherebookname='

+name+"

if(rs.next())

stmt.executeUpdate("

jpane.setVisible(true);

else

jLabel.setText("

请输入正确的书名"

}catch(SQLExceptione){

publicvoidaupdate(){

修改成功"

elsejLabel.setText("

修改失败"

publicvoidsendbook(){

intbcount=rs.getInt("

if(bcount<

=0){

jLabel.setText("

书已经全部借完"

return;

stmt.executeUpdate("

updatebookmissetcount=count-1wherebookname='

借阅成功"

没有这本书"

publicvoidbackbook(){

updatebookmissetcount=count+1wherebookname='

还书成功"

MainMenu类

packageview;

importaccess.Access;

publicclassMainMenu{

privateJFramejFrame=null;

//@jve:

decl-index=0:

visual-constraint="

159,78"

privateJPaneljContentPane=null;

privateJLabeljLabel=null;

privateJTextFieldjTextField=null;

privateJLabeljLabel1=null;

privateJButtonjButton=null;

privateJButtonjButton1=null;

privateJPasswordFieldjPasswordField=null;

/**

*ThismethodinitializesjFrame

*

*@return

*/

publicJFramegetJFrame(){

if(jFrame==null){

jFrame=newJFrame();

jFrame.setSize(newDimension(461,320));

jFrame.setTitle("

图书管理系统登陆界面"

jFrame.setContentPane(getJContentPane());

jFrame.setVisible(true);

returnjFrame;

*ThismethodinitializesjContentPane

privateJPanelgetJContentPane(){

if(jContentPane==null){

jLabel1=newJLabel();

jLabel1.setBounds(newRectangle(30,121,167,30));

jLabel1.setText("

密码"

jLabel=newJLabel();

jLabel.setBounds(newRectangle(30,45,167,31));

用户名"

jContentPane=newJPanel();

jContentPane.setLayout(null);

jContentPane.add(jLabel,null);

jContentPane.add(getJTextField(),null);

jContentPane.add(jLabel1,null);

jContentPane.add(getJButton(),null);

jContentPane.add(getJButton1(),null);

jContentPane.add(getJPasswordField(),null);

returnjContentPane;

*ThismethodinitializesjTextField

privateJTextFieldgetJTextField(){

if(jTextField==null){

jTextField=newJTextField();

jTextField.setBounds(newRectangle(211,44,223,35));

returnjTextField;

*ThismethodinitializesjButton

privateJButtongetJButton(){

if(jButton==null){

jButton=newJButton();

jButton.setBounds(newRectangle(61,211,121,32));

jButton.setText("

登陆"

jButton.addActionListener(newr(){

publicvoid

Stringusername=jTextField.getText();

Stringpassword=jPasswordField.getText();

Accessaccess=newAccess(username,password);

access.login();

jFrame.setVisible(false);

}

});

returnjButton;

*ThismethodinitializesjButton1

privateJButtongetJButton1(){

if(jButton1==null){

jButton1=newJButton();

jButton1.setBounds(newRectangle(269,210,139,32));

jButton1.setText("

注册"

jButton1.addActionListener(new

Regsditregsdit=newRegsdit();

regsdit.getJFrame();

returnjButton1;

/**

*ThismethodinitializesjPasswordField

privateJPasswordFieldgetJPasswordField(){

if(jPasswordField==null){

jPasswordField=newJPasswordField();

jPasswordField.setBounds(newRectangle(211,121,225,29));

returnjPasswordField;

publicstaticvoidmain(Stringa[])

{

MainMenumainmenu=newMainMenu();

mainmenu.getJFrame();

MainCl类

importja

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

当前位置:首页 > 表格模板 > 合同协议

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

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