java-- 登陆界面

import java.awt.*; 
import javax.swing.*; 
import java.util.Random; 
public class tu1 {
	public static void main(String[] args) {
		JFrame s = new JFrame("登陆界面"); 
		Container con = s.getContentPane();
		s.setBounds(100, 100, 500, 500);
	    con.setBackground(Color.green);
		s.setVisible(true);
		s.setResizable(true);  
	    s.setLayout(null);
	    JLabel label = new JLabel ("用户名:");
		label.setBounds(80, 100, 60, 30);
		s.add(label);
		JLabel label1 = new JLabel("密码:");
		label1.setBounds(90, 140, 60, 30);
	    s.add(label1);
	    JTextField textbook=new JTextField();  
        textbook.setBounds(130, 110,180, 20); 
         JTextField textbook1=new JTextField();  
        textbook1.setBounds(130, 150,180, 20); 
        JTextField textbook2=new JTextField();  
        textbook2.setBounds(130, 180,180, 20); 
        
         JLabel label2=new JLabel("验证码:");  
        label2.setBounds(80, 180, 50, 20); 
        Random rd=new Random();  
        int x = rd.nextInt(9000);
        JLabel label3=new JLabel(Integer.toString(x+1000));  
        label3.setBounds(180, 210, 50, 20); 
         
         s.add(label2); 
         s.add(label3);
         s.add(textbook);
         s.add(textbook1);
         s.add(textbook2);
         JButton button1=new JButton("确定");  
         button1.setBounds(150, 300, 60, 20);  
         JButton button2=new JButton("取消");  
         button2.setBounds(210,300, 60, 20); 
          s.add(button1);
         s.add(button2);  
         
		}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值