import java.awt.*;
import javax.swing.*;
public class L5_7 extends JFrame{
JButton an1,an2;
JPanel mb1,mb2,mb3;
JLabel bq1,bq2;
JTextField wb1;
JPasswordField mmk;
L5_7(){
mb1=new JPanel();
mb2=new JPanel();
mb3=new JPanel();
an1=new JButton("登陆");
an2=new JButton("取消");
bq1=new JLabel("用户名");
bq2=new JLabel("密 码");
wb1=new JTextField(10);
mmk=new JPasswordField(10);
this.setLayout(new GridLayout(3,1));
mb1.add(bq1); mb1.add(wb1);
mb2.add(bq2); mb2.add(mmk);
mb3.add(an1); mb3.add(an2);
this.add(mb1);
this.add(mb2);
this.add(mb3);
this.setTitle("用户登录界面");
this.setSize(230,150);
this.setLocation(200, 300);
this.setResizable(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
L5_7 Kk = new L5_7();
}
}
请编辑设计一个登陆界面,要求输入帐号和密码(不考虑事件)
最新推荐文章于 2023-02-17 08:50:52 发布