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;publicclassCextendsJFrame{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();this.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);this.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.setDefaultCloseOperation(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;publicclassjiemianextendsJFrame{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(图书流通);jb4=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(newMyListener1());jb2.addActionListener(newMyListener2());jb3.addActionListener(newMyListener3());jb4.addActionListener(newMyListener4());jb5.addActionListener(newMyListener5());jb6.addActionListener(newMyListener6());this.setVisible(true);}classMyListener1implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb1){newjiemian1();o.dispose();}}}classMyListener2implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb2){newjiemian2();o.dispose();}}}classMyListener3implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb3){newjiemian3();o.dispose();}}}classMyListener4implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb4){newjiemian4();o.dispose();}}}classMyListener5implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb5){newjiemian5();o.dispose();}}}classMyListener6implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb6){newjiemian6();o.dispose();}}}publicstaticvoidmain(String[]args){o=newjiemian();o.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);o.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;publicclassjiemian1extendsJFrame{JButtonjb3;staticjiemian1o;jiemian1(){this.setVisible(true);this.setTitle(图书采购);this.setSize(600,400);this.setLocation(300,200);JLabeljl=newJLabel(newImageIcon(g://2.jpg));//添加背景JButtonjb1=newJButton(订单查询);JButtonjb2=newJButton(新书通报);jb3=newJButton(返回);this.add(jb1);this.add(jb2);this.add(jb3);this.setLayout(null);jl.setBounds(0,0,600,400);//设置背景大小this.add(jl);this.setLayout(newFlowLayout());this.setVisible(true);jb3.addActionListener(newMyListener3());}classMyListener3implementsActionListener{publicvoidactionPerformed(ActionEvente){if(e.getSource()==jb3){newjiemian();o.dispose();}}}publicstaticvoidmain(String[]args){o=newjiemian1();o.setVisible(true);}}