资源描述:
《图书管理系统登录界面 编码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、packageB;importjava.awt.Color;importjava.awt.Font;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjavax.swing.ImageIcon;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JPasswordField;importjavax.swing.JTextField;pu
2、blicclassCextendsJFrame{staticCd;JButtonjb1,jb2,jb3;C(){this.setTitle("登陆");this.setSize(600,400);this.setLocation(600,400);JLabeljl=newJLabel(newImageIcon("g://6.jpg"));//添加背景Fontf=newFont("Serif",Font.BOLD,14);//设置字体JTextFieldjt=newJTextField();JPasswordFieldjp=newJPasswordField();thi
3、s.setLayout(null);jb1=newJButton("登陆");jb1.addActionListener(newMyListener());//添加监听jb1.setBackground(Color.gray);//设置背景颜色jb2=newJButton("注册");jb2.setBackground(Color.gray);jt.setBounds(90,150,90,20);jp.setBounds(90,190,90,20);jb1.setBounds(50,250,60,20);jb2.setBounds(120,250,60,20);thi
4、s.add(jt);this.add(jp);this.add(jb1);this.add(jb2);this.setLayout(null);jl.setBounds(0,0,600,400);//设置背景大小this.add(jl);}classMyListenerimplementsActionListener{publicvoidactionPerformed(ActionEventarg0){d.dispose();newjiemian();}}publicstaticvoidmain(String[]args){d=newC();d.setDefaultC
5、loseOperation(JFrame.DISPOSE_ON_CLOSE);d.setVisible(true);}}packageB;importjava.awt.FlowLayout;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjavax.swing.ImageIcon;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JLabel;publicclassjiemiane
6、xtendsJFrame{JButtonjb1,jb2,jb3,jb4,jb5,jb6;staticjiemiano;jiemian(){this.setVisible(true);this.setTitle("图书馆管理系统");this.setSize(600,400);this.setLocation(300,200);JLabeljl=newJLabel(newImageIcon("g://2.jpg"));//添加背景jb1=newJButton("图书采购");jb2=newJButton("图书入库");jb3=newJButton("图书流通");jb
7、4=newJButton("读者管理");jb5=newJButton("统计查询");jb6=newJButton("系统设置");this.add(jb1);this.add(jb2);this.add(jb3);this.add(jb4);this.add(jb5);this.add(jb6);this.setLayout(null);jl.setBounds(0,0,600,400);//设置背景大小this.add(jl);this.setLayout(newFlowLayout());jb1.addActionListener(newMy