public class Denglu {
static Label zh,zm;
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setSize(300,300);//宽,高
frame.setLocation(300, 300);//左上角坐标
frame.setTitle("QQ登陆");
frame.setResizable(true);
frame.setVisible(true);
JPanel panel1=new JPanel();
panel1.setBounds(0, 0, 200, 200);
panel1.setBackground(Color.white);
frame.add(panel1);
zh = new Label("账号");
panel1.add(zh);
JTextField wb = new JTextField(16);
wb.setBounds(80, 50, 120, 26);
panel1.add(wb);
zm = new Label("密码");
panel1.add(zm);
JPasswordField mm=new JPasswordField(16);
mm.setEchoChar('*');
mm.setBounds(120, 50, 120, 26);
panel1.add(mm);
JButton btn1 = new JButton("确定");
btn1.setBounds(60, 100, 60, 26);
panel1.add(btn1);
JButton btn2 = new JButton("取消");
btn2.setBounds(100, 100, 80, 26);
panel1.add(btn2);
}
}
static Label zh,zm;
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setSize(300,300);//宽,高
frame.setLocation(300, 300);//左上角坐标
frame.setTitle("QQ登陆");
frame.setResizable(true);
frame.setVisible(true);
JPanel panel1=new JPanel();
panel1.setBounds(0, 0, 200, 200);
panel1.setBackground(Color.white);
frame.add(panel1);
zh = new Label("账号");
panel1.add(zh);
JTextField wb = new JTextField(16);
wb.setBounds(80, 50, 120, 26);
panel1.add(wb);
zm = new Label("密码");
panel1.add(zm);
JPasswordField mm=new JPasswordField(16);
mm.setEchoChar('*');
mm.setBounds(120, 50, 120, 26);
panel1.add(mm);
JButton btn1 = new JButton("确定");
btn1.setBounds(60, 100, 60, 26);
panel1.add(btn1);
JButton btn2 = new JButton("取消");
btn2.setBounds(100, 100, 80, 26);
panel1.add(btn2);
}
}