资源描述:
《java编写地简单图书管理系统的》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用标准文案Java编写的简单图书管理系统主界面代码实现packageLibrary;importjava.awt.BorderLayout;importjava.awt.Color;importjava.awt.Container;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.Res
2、ultSet;importjava.sql.SQLException;importjava.sql.Statement;importjavax.swing.ImageIcon;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JOptionPane;importjavax.swing.JPanel;importjavax.swing.JPasswordField;importj
3、avax.swing.JTextField;publicclassLoginextendsJFrame{精彩文档实用标准文案privatestaticfinallongserialVersionUID=1L;privateJLabeljlUsername;privateJLabeljlPwd;privateJTextFieldtxtUsername;//用户名privateJTextFieldtxtPassword;//密码privateJButtonjbOk;privateJButtonjbCancel;pub
4、licJLabelgetJlUsername(){if(jlUsername==null){jlUsername=newJLabel("账号");jlUsername.setForeground(Color.BLACK);jlUsername.setBounds(118,40,85,30);}returnjlUsername;}publicJLabelgetJlPwd(){if(jlPwd==null){jlPwd=newJLabel("密码");jlPwd.setForeground(Color.BLACK);
5、jlPwd.setBounds(118,100,85,30);}returnjlPwd;}publicJTextFieldgetTxtUsername(){if(txtUsername==null){txtUsername=newJTextField(20);txtUsername.setBounds(180,40,200,30);}returntxtUsername;}publicJTextFieldgetTxtPassword(){精彩文档实用标准文案if(txtPassword==null){txtPass
6、word=newJPasswordField(20);txtPassword.setBounds(180,100,200,30);}returntxtPassword;}publicJButtongetJbOk(){if(jbOk==null){jbOk=newJButton("登陆");jbOk.setBounds(150,180,90,30);//jbOk.addActionListener(this);}returnjbOk;}publicJButtongetJbCancel(){if(jbCancel==
7、null){jbCancel=newJButton("取消");jbCancel.setBounds(300,180,90,30);}returnjbCancel;}publicLogin(Stringtitle){super(title);//JFrameframe=newJFrame();Containercantainer=this.getContentPane();this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);ImageIconimg=newIma
8、geIcon("F:\Java\传习\src\Library\ZF`XY`H48I_}U)C4~}M2~C4.jpg");//这是背景图片JLabelimgLabel=newJLabel(img);//将背景图放在标签里。this.getLayeredPane().add(imgLabel,newInteger(Integer.MIN_VALUE));//注意这