下载此文档

图书管理系统---java代码模板.doc


文档分类:IT计算机 | 页数:约24页 举报非法文档有奖
1/24
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/24 下载此文档
文档列表 文档介绍
图书管理系统---java代码import.*;import.*;import.*;import.*;import.*;//---------------------------------------------------------------------------------------------------------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); (mdenglu); (mtianjia); (mchaxun); (mshanchu); (mexit); (mhelpp); (mfile); (mhelp); setMenuBar(daohang); add(pmain); addWindowListener(newWindowAdapter(){ publicvoidwindowClosing(WindowEvente){ (0); } }); setBounds(200,200,340,250); setResizable(false); setVisible(true); (this); (this); (this); (this); (this); (this); validate(); }//窗口事件监听 publicvoidactionPerformed(ActionEvente){ if(()==mexit) (0); if(()==mdenglu){ removeAll(); add(pdenglu); validate(); } if(()==mtianjia){ removeAll(); add(ptianjia); validate(); }//图书添加功能 if(()==mchaxun){ removeAll(); add(pchaxun); validate(); }//图书查询功能 if(()==mshanchu){ removeAll(); add(pshanchu); validate(); }//图书删除功能 if(()==mhelpp){ (this,"欢迎使用图书管理系统","关于本系统", ); } }//各功能菜单事件监听}//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("评论"); a

图书管理系统---java代码模板 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数24
  • 收藏数0 收藏
  • 顶次数0
  • 上传人读书百遍
  • 文件大小39 KB
  • 时间2019-12-29