请编辑设计一个登陆界面,要求输入帐号和密码(不考虑事件)

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();
	}

}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值