态
} button1.addActionListener(this); button2.addActionListener(this); button3.addActionListener(this); button4.addActionListener(this); button5.addActionListener(this); button6.addActionListener(this); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); } }); bg = new ImageIcon("ckou.jpg"); JLabel label = new JLabel(bg); label.setBounds(0, 0, bg.getIconWidth(), bg.getIconHeight()); imagePanel = (JPanel) frame.getContentPane(); imagePanel.setOpaque(false); imagePanel.setLayout(new FlowLayout()); imagePanel.add(p1, BorderLayout.NORTH); imagePanel.add(box, BorderLayout.CENTER); frame.getLayeredPane().setLayout(null); frame.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置关闭后状frame.setSize(bg.getIconWidth(), bg.getIconHeight()); frame.setBounds(200, 200, 500, 300); frame.setResizable(false);//设置窗口大小不可改变 frame.setVisible(true); validate(); public void actionPerformed(ActionEvent e) { if (e.getSource() == button6) { System.exit(0); } if (e.getSource() == button1) { new charu(); } if (e.getSource() == button2) { new shanchu(); } if (e.getSource() == button3) { 9