java UI之QQ登录

package com.SwingIn51;
import java.awt.*;
import javax.swing.*;
public class QQLanuch extends JFrame{
	JLabel label_North;//北部
	JButton button_South1,button_South2,button_South3;//南部
	JPanel panel_South1;
	JTabbedPane tabbedPane;//中部
	JPanel panel_Center2,panel_Center3,panel_Center4;
	JLabel label2,label3,label4,label5;
	JTextField textField;
	JPasswordField passwordField;
	JButton button4;
	JCheckBox checkBox1,checkBox2;
	public QQLanuch() {
		label2=new JLabel("QQ号码:",JLabel.CENTER);
		label3=new JLabel("QQ密码:",JLabel.CENTER);
		label4=new JLabel("忘记密码:",JLabel.CENTER);
		label4.setFont(new Font("宋体",Font.PLAIN,16));//设置字体
		label4.setForeground(Color.BLUE);//设置字体颜色
		label5=new JLabel("<html><a href='www.qq.com'>申请密码保护</a>");//设置标签链接
		label5.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));//设置指针(指鼠标的)的预定义样式
		
		textField=new JTextField();
		passwordField=new JPasswordField();
		button4=new JButton("清除号码");
		
		checkBox1=new JCheckBox("隐身登录");
		checkBox2=new JCheckBox("记住密码");
		
		label_North=new JLabel(new ImageIcon("image/car.jpg"));//设置图片
		panel_South1=new JPanel();
		button_South1=new JButton("登录");
		button_South2=new JButton("取消");
		button_South3=new JButton("向导");
		
		tabbedPane=new JTabbedPane();
		panel_Center2=new JPanel();
		panel_Center3=new JPanel();
		panel_Center4=new JPanel();
		panel_Center3.setBackground(Color .BLACK);//设置面板颜色
		panel_Center4.setBackground(Color.BLUE);
		
		tabbedPane.add("普通用户", panel_Center2);
		tabbedPane.add("QQ会员", panel_Center3);
		tabbedPane.add("管理员", panel_Center4);
		
		panel_Center2.setLayout(new GridLayout(3,3));//面板2位3行3列
		
		panel_South1.add(button_South1);
		panel_South1.add(button_South2);
		panel_South1.add(button_South3);
		
		panel_Center2.add(label2);
		panel_Center2.add(textField);
		panel_Center2.add(button4);
		panel_Center2.add(label3);
		panel_Center2.add(passwordField);
		panel_Center2.add(label4);
		panel_Center2.add(checkBox1);
		panel_Center2.add(checkBox2);
		panel_Center2.add(label5);
		
		this.add(panel_South1,BorderLayout.SOUTH);//把三个组件添加到JFame中
		this.add(tabbedPane, BorderLayout.CENTER);
		this.add(label_North, BorderLayout.NORTH);
		
		this.setTitle("用户登录");
		this.setSize(340, 270);
		this.setLocation(300, 280);
		this.setResizable(false);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
		
		ImageIcon head_Image=new ImageIcon("image/car.jpg");//设置图标
		this.setIconImage(head_Image.getImage());
		
		}
	public static void main(String[] args) {
		QQLanuch a=new QQLanuch();
	}
	

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.ImageIcon; import javax.swing.*; import java.lang.*; import java.sql.*; class Imagecanvas extends Canvas { Toolkit tool; Image Im; Imagecanvas() { setSize(360, 50); tool = getToolkit(); Im = tool.getImage("dj.jpg"); } public void paint(Graphics g) { g.drawImage(Im, 0, 0, 360, 50, this); } } class QqBorder1 extends JFrame implements ActionListener { Choice cho; QqBorder1() { super("QQ2010"); setSize(360, 260); setLocation(250, 120); setResizable(false); Container c = getContentPane(); FlowLayout layout = new FlowLayout(FlowLayout.CENTER); JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); JPanel p3 = new JPanel(); cho = new Choice(); cho.add("在线"); cho.add("隐身"); cho.add("离线"); cho.add("忙碌"); cho.add("请勿打扰"); Imagecanvas canvas1 = new Imagecanvas(); p1.setSize(360, 50); p1.add(canvas1); TextField username = new TextField(25); TextField password = new TextField(25); password.setEchoChar('*'); JButton btrystu = new JButton("登陆"); JButton sezhi = new JButton("设置"); JCheckBox check1 = new JCheckBox("记住密码"); JCheckBox check2 = new JCheckBox("自动登陆"); // p1.setSize(360, 200); JPanel p21 = new JPanel(); JPanel p22 = new JPanel(); p21.add(new JLabel("账号:")); p21.add(username); p21.add(new JLabel("<html><font color=blue>注册新账号</font></html>")); // p21.add(new JLabel(" ")); p21.add(new JLabel("密码:")); p21.add(password); p21.add(new JLabel("<html><font color=blue> 找 回 密 码 </font></html>")); p22.add(new JLabel("状态:")); p22.add(new JLabel(" ")); p22.add(cho); p22.add(check1); p22.add(check2); p22.add(new JLabel(" ")); p2.add(p21); p2.add(p22); p2.setBounds(100, 300, 200, 300); p2.setLayout(new GridLayout(2, 1, 10, 10)); p3.add(sezhi); p3.add(new JLabel(" ")); p3.add(btrystu); add(BorderLayout.NORTH, p1); add(BorderLayout.CENTER, p2); add(BorderLayout.SOUTH, p3); this.setVisible(true); } public void actionPerformed(ActionEvent e) { } } public class QqBorder { }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值