图书管理系统总报告(编辑修改稿)内容摘要:

0。 BookBrower() { f=new JFrame(预览图书 )。 cp=()。 jpS=new JPanel()。 jpanelWest=new JPanel()。 jbt1=new JButton(确定 )。 ()。 jbt2=new JButton(返回 )。 ()。 label=new JLabel(htmlfont size=39。 539。 amp。 nbsp。 + 预览书库 brhr立志宜思真品格,读书须尽苦功夫 ——阮元/font,)。 ()。 L=new JLabel(书库现在共有图书 +count+本 )。 table=new JTable(ar,columnName)。 JScrollPane scrollpane = new JScrollPane(table)。 (jbt1)。 (jbt2)。 JPanel jpanel=new JPanel()。 (label)。 JPanel pp4=new JPanel()。 JPanel jpE=new JPanel()。 (jpanel,North)。 JPanel jp=new JPanel()。 JPanel p=new JPanel()。 //用来放两个表 (new BorderLayout())。 (L,North)。 (scrollpane)。 (pp4,West)。 (p,Center)。 (jpS,South)。 (jpE,East)。 ()。 ()。 ()。 (1000,600)。 (true)。 (this)。 //注册监听器 (this)。 } int i=0。 public void showRecord() { while(i=0) { ar[i][0]=。 ar[i][1]=。 ar[i][2]=。 ar[i][3]=。 ar[i][4]=。 ar[i][5]=。 i。 } i=0。 try{ ()。 }catch(ClassNotFoundException e){(加载驱动程序失败 !)。 } try{ String url = jdbc:odbc:Book。 Connection con=(url)。 String s=select * from book。 Statement sql=()。 ResultSet rs=(s)。 while(()) { String bname=(1)。 String bno=(2)。 String price=(3)。 String writer=(4)。 String publish=(5)。 String indate=(6)。 ar[i][0]=bname。 ar[i][1]=bno。 ar[i][2]=price。 ar[i][3]=writer。 ar[i][4]=publish。 ar[i][5]=indate。 i++。 } count=+i+。 (书库现在共有图书 +count+本 )。 ()。 ()。 }catch(SQLException g) { (())。 (())。 } } public void actionPerformed(ActionEvent e) { String cmd=()。 if((确定 )) { ()。 } if((返回 )) ()。 } public static void main(String []arg){ BookBrower a=new BookBrower()。 ()。 } } //新书登记 import .*。 import .*。 import .*。 import。 import .*。 import .*。 import。 class BookIn implements ActionListener { JFrame f3。 Container cp。 JPanel jp1,jp2,jp3,jp4,jp,jpanelWest。 JButton jbt1,jbt2。 JLabel label。 JTextField tf1,tf2,tf3,tf4,tf5,tf6。 JLabel label1,label2,label3,label4。 String sno。 BookIn() { f3=new JFrame(图书信息添加 )。 cp=()。 jp1=new JPanel()。 jp2=new JPanel()。 jp3=new JPanel()。 jp4=new JPanel()。 jpanelWest=new JPanel()。 jp=new JPanel()。 jbt1=new JButton(确定 )。 jbt2=new JButton(取消 )。 label=new JLabel(htmlfont size=39。 439。 新书登记/font,)。 ()。 tf1=new JTextField(20)。 tf2=new JTextField(20)。 tf3=new JTextField(20)。 tf4=new JTextField(20)。 tf5=new JTextField(20)。 tf6=new JTextField(20)。 (jbt1)。 (jbt2)。 JPanel jpanel=new JPanel()。 (label)。 JPanel pp4=new JPanel()。 JPanel jpane4=new JPanel()。 (jpanel,North)。 JPanel pp2=new JPanel(new GridLayout(6,1,20,10))。 JPanel pp3=new JPanel()。 (new GridLayout(6,1))。 (new JLabel(图书名 ,))。 (tf1)。 (new JLabel(图书号 ,))。 (tf2)。 (new JLabel(单 价 ,))。 (tf3)。 (new JLabel(作 者 ,))。 (tf4)。 (new JLabel(出版社 ,))。 (tf5)。 (new JLabel(入库时间 ,))。 (tf6)。 (jbt1)。 (jbt2)。 (pp4,West)。 (pp2,East)。 (pp3,South)。 (jpane4,Center)。 (320,300)。 (true)。 (this)。 (this)。 } public void insertRecord() { if(().equals()||().equals()||().equals()|| ().equals()||().equals()||().equals()) { (f3,请填写图书资料 )。 return。 } try{ ()。 }catch(ClassNotFoundException e) {(加载驱动程序失败 !)。 } try{ String url = jdbc:odbc:Book。 Connection con=(url)。 Statement sql。 String s=insert into book values(39。 +()+39。 ,39。 +()+39。 ,39。 + ()+39。 ,39。 +()+39。 ,39。 +()+39。 ,39。 +()+39。 )。 String query=select * from book where 图书号 =39。 +()+39。 sql=()。 ResultSet rs=(query)。 boolean moreRecords=()。 if(moreRecords) { (f3,图书号已经被使用,请重新输入)。 ()。 ()。 return。 } int insert=(s)。 if(insert==1) { (null,图书信息录入成功。 )。 ()。 ()。 ()。 ()。 ()。 ()。 } }catch(SQLException g) { (())。 (())。 } } public void actionPerformed(ActionEvent e) { String cmd=()。 if((确定 )) { insertRecord()。 } else if((取消 )) ()。 } public static void main(String []arg){ BookIn a=new BookIn()。 } } //查询图书 import .*。 import .*。 import .*。 impor。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。