我的问题如下:
假设
[code=java]
package zxw_Login;
import java.awt.Checkbox;
import java.awt.Choice;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
public class Login_Vo extends JFrame{
JLayeredPane lay = new JLayeredPane();
JPanel jp = new JPanel();
ImageIcon image = new ImageIcon("C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\示例图片\\Sunset.jpg");
JLabel jb = new JLabel(image);
JFrame jf = null;
JPanel jp1 = null;
JPanel jp2 = null;
JLabel jl1 =null;
JLabel jl2 =null;
JLabel jl3 =null;
JLabel jl4 =null;
JTextField jt1 = null;
JPasswordField jt2 = null;
Choice ch = null;
Checkbox cb1 = null;
Checkbox cb2 = null;
JButton jb1 = null;
JButton jb2 = null;
JButton jb3 = null;
JButton jb4 = null;
Font font = null;
Login_Vo(){
this.setLayeredPane(lay);
// jf = new JFrame("欢迎光临在线商城");
this.setBounds(600,200,400,500);
this.setLayout(null);
this.setResizable(false);
this.setVisible(true);
jp.add(jb);
jp.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
jp.add(jb);
jp1 = new JPanel();
jp1.setBounds(0,0,400,100);
jp1.setBackground(Color.GREEN);
jl1 = new JLabel("欢迎光临在线商城",JLabel.CENTER);
font = new Font("华文彩云",0,40);
jl1.setForeground(Color.RED);
jl1.setFont(font);
jp2 = new JPanel();
jp2.setBounds(0,100,400,400);
jp2.setBackground(Color.WHITE);
jp2.setLayout(null);
jl2 = new JLabel("账号");
jl2.setBounds(100,50,80,20);
jt1 =new JTextField();
jt1.setBounds(200,50,120,20);
jl3 = new JLabel("密码");
jl3.setBounds(100,90,80,20);
jt2 = new JPasswordField();
jt2.setBounds(200,90,120,20);
jl4 = new JLabel("身份");
jl4.setBounds(100,130,120,20);
ch = new Choice();