电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

图书管理系统---java代码VIP免费

图书管理系统---java代码_第1页
1/10
图书管理系统---java代码_第2页
2/10
图书管理系统---java代码_第3页
3/10
importjava.awt.*;importjava.awt.event.*;importjava.sql.*;importjava.util.*;importjavax.swing.*;//---------------------------------------------------------------------------------------------------------classTsgl{publicstaticvoidmain(Stringargs[]){dbframedb=newdbframe("图书管理程序");}}//图书管理系统主界面classdbframeextendsFrameimplementsActionListener{MenuBardaohang=newMenuBar();//建立菜单栏Menumfile=newMenu("功能");//建立“功能”菜单组Menumhelp=newMenu("帮助");//建立“帮助”菜单组MenuItemmdenglu=newMenuItem("登陆");MenuItemmchaxun=newMenuItem("查询");MenuItemmtianjia=newMenuItem("添加");MenuItemmshanchu=newMenuItem("删除");MenuItemmexit=newMenuItem("退出");MenuItemmhelpp=newMenuItem("关于");Denglupdenglu=newDenglu();Ptianjiaptianjia=newPtianjia();Pmainpmain=newPmain();Pchaxunpchaxun=newPchaxun();Pshanchupshanchu=newPshanchu();dbframe(Strings){//在窗口上添加菜单选项setTitle(s);mfile.add(mdenglu);mfile.add(mtianjia);mfile.add(mchaxun);mfile.add(mshanchu);mfile.add(mexit);mhelp.add(mhelpp);daohang.add(mfile);daohang.add(mhelp);setMenuBar(daohang);add(pmain);addWindowListener(newWindowAdapter(){publicvoidwindowClosing(WindowEvente){System.exit(0);}});setBounds(200,200,340,250);setResizable(false);setVisible(true);mexit.addActionListener(this);mdenglu.addActionListener(this);mtianjia.addActionListener(this);mchaxun.addActionListener(this);mshanchu.addActionListener(this);mhelpp.addActionListener(this);validate();}//窗口事件监听publicvoidactionPerformed(ActionEvente){if(e.getSource()==mexit)System.exit(0);if(e.getSource()==mdenglu){removeAll();add(pdenglu);validate();}if(e.getSource()==mtianjia){removeAll();add(ptianjia);validate();}//图书添加功能if(e.getSource()==mchaxun){removeAll();add(pchaxun);validate();}//图书查询功能if(e.getSource()==mshanchu){removeAll();add(pshanchu);validate();}//图书删除功能if(e.getSource()==mhelpp){JOptionPane.showMessageDialog(this,"欢迎使用图书管理系统","关于本系统",JOptionPane.INFORMATION_MESSAGE);}}//各功能菜单事件监听}//classPtianjiaextendsPanelimplementsActionListener{TextFieldtname,tauthor,tpublish,tdate,tcomment;Labellname,lauthor,lpublish,ldate,lcomment;Buttonbtn;Ptianjia(){setLayout(null);btn=newButton("添加");//创建“添加”按钮tname=newTextField();tauthor=newTextField();tpublish=newTextField();tdate=newTextField();tcomment=newTextField();//创建5个文本框lname=newLabel("书名");lauthor=newLabel("作者");lpublish=newLabel("出版社");ldate=newLabel("出版日期");lcomment=newLabel("评论");add(lname);add(tname);add(lauthor);add(tauthor);add(lpublish);add(tpublish);add(ldate);add(tdate);add(lcomment);add(tcomment);add(btn);//添加“按钮”到窗口面板上lname.setBounds(10,10,70,25);tname.setBounds(90,10,220,25);lauthor.setBounds(10,40,70,25);tauthor.setBounds(90,40,220,25);lpublish.setBounds(10,70,70,25);tpublish.setBounds(90,70,220,25);ldate.setBounds(10,100,70,25);tdate.setBounds(90,100,220,25);lcomment.setBounds(10,130,70,25);tcomment.setBounds(90,130,220,25);btn.setBounds(130,160,70,25);//设置按钮位置btn.addActionListener(this);//设置按钮监听setSize(340,250);//设置窗口大小setBackground(Color.white);//设置窗口背景颜色setVisible(true);validate();}publicvoidactionPerformed(ActionEvente){Stringsname=tname.getText();Stringsauthor=tauthor.getText();Stringspublish=tpublish.getText();Stringsdate=tdate.getText();Stringscomment=tcomment.getText();Stringinse...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

图书管理系统---java代码

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部