QQ登陆窗口

/**
 * qq登陆界面,韩顺平
 */


package com.test1;

import javax.swing.*;
import java.awt.*;


public class QqLogin extends JFrame
{

	
	JLabel jl1,jl2,jl3,jl4,jl5;
	JTextField jtf;
	JPasswordField jpf;
	JButton jb1,jb2,jb3,jb4;
	JCheckBox jcb1,jcb2;
	JTabbedPane jtp;
	JPanel jp1,jp2,jp3,jp4;
	
	
	public static void main(String[] args)
	{
		// TODO Auto-generated method stub
		 new QqLogin();

	}
	public QqLogin()
	{
		jl2 = new JLabel("QQ号码",JLabel.CENTER);
		jl3 = new JLabel("QQ密码",JLabel.CENTER);
		jl4 = new JLabel("忘记密码",JLabel.CENTER);
		jl5 = new JLabel("<html><a href = 'www.qq.com'>申请密码保护</a>");
		jl5.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		
		
		
		jtf = new JTextField(); //输入号码框
		jpf = new JPasswordField();//输入密码框
		
		jb4 = new JButton(new ImageIcon("pic/Winter.jpg"));
		
		//复选框
		jcb1 = new JCheckBox("隐身登陆");
		jcb2 = new JCheckBox("记住密码");
		
		//北部区域
		jl1 = new JLabel(new ImageIcon("pic/Blue hill.jpg"));
		
		
		//南部区域
		jp1 = new JPanel();
		jb1 = new JButton(new ImageIcon("pic/Sunset.jpg"));
		jb2 = new JButton(new ImageIcon("pic/Winter.jpg"));
		jb3 = new JButton(new ImageIcon("pic/SETUP.bmp"));
		
		
		
		//中部区域
		jtp = new JTabbedPane();//选项卡窗格
		jp2 = new JPanel();
		jp3 = new JPanel();
		jp3.setBackground(Color.RED);//给面板设置背景色
		jp4 = new JPanel();
		jp4.setBackground(new Color(0,0,255));
		
		//将面板添加到选项卡窗格上
		jtp.add("QQ号码",jp2);
		jtp.add("手机号码",jp3);
		jtp.add("电子邮箱",jp4);
		
		//设置布局
		jp2.setLayout(new GridLayout(3,3));
		
		jp1.add(jb1);
		jp1.add(jb2);
		jp1.add(jb3);
		
		jp2.add(jl2);//输入QQ号
		jp2.add(jtf);//输入号码框
		jp2.add(jb4);//输入图片
		
		jp2.add(jl3);//输入QQ密码
		jp2.add(jpf);//输入密码框
		jp2.add(jl4);
		
		jp2.add(jcb1);
		jp2.add(jcb2);
		jp2.add(jl5);
		
		
		this.add(jp1,BorderLayout.SOUTH);
		this.add(jl1,BorderLayout.NORTH);
		this.add(jtp,BorderLayout.CENTER);
		
		//展现组件
		ImageIcon icon = new ImageIcon("pic/Water lilies.jpg");
		this.setIconImage(icon.getImage());
		
		this.setSize(500,500);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		this.setVisible(true);
	}
	
	
	

}

你可能感兴趣的:(QQ登陆窗口)