Java Swing 实现QQ登录页面

Java Swing 实现QQ登录页面

代码如下:

import java.awt.*;
import javax.swing.*; 
public class Demo121 extends JFrame{
	public Demo121()
	{
		JPanel jp1=new JPanel();
		JPanel jp2=new JPanel();
		JPanel jp3=new JPanel();
		

		
		Icon icon1=new ImageIcon(getClass().getResource("/com/res/tou.gif"));
		Icon icon2=new ImageIcon(getClass().getResource("/com/res/clear.gif"));
		Icon icon3=new ImageIcon(getClass().getResource("/com/res/denglu.gif"));
		Icon icon4=new ImageIcon(getClass().getResource("/com/res/quxiao.gif"));
		Icon icon5=new ImageIcon(getClass().getResource("/com/res/xiangdao.gif"));
	
		
		JButton jb1=new JButton();
		JButton jb2=new JButton();
		JButton jb3=new JButton();
		JButton jb4=new JButton();
		JButton jb5=new JButton();
		jb1.setIcon(icon1);
		jb2.setIcon(icon2);
		jb3.setIcon(icon3);
		jb4.setIcon(icon4);
		jb5.setIcon(icon5);
		
		JTabbedPane jta=new JTabbedPane(JTabbedPane.TOP);
		JPanel jp4=new JPanel();
		JPanel jp5=new JPanel();
		JPanel jp6=new JPanel();
		jta.addTab("QQ号码", jp4);
		jta.addTab("手机号码", jp5);
		jta.addTab("邮箱号码", jp6);
		
		
		
		JLabel jla1=new JLabel("QQ号码");
		JLabel jla2=new JLabel("QQ密码");
		JLabel jla3=new JLabel("忘记密码");
		jla3.setFont(new Font("宋体",Font.BOLD,16));
		jla3.setForeground(Color.BLUE);
		
	
		JLabel jla4=new JLabel("申请密码保护");
		jla4.setForeground(Color.BLUE);
		
		JRadioButton jra1=new JRadioButton("隐身登陆");
		JRadioButton jra2=new JRadioButton("记住密码");
		JTextField jte=new JTextField(10);
		JPasswordField jpa=new JPasswordField(10);
		jp4.setLayout(new GridLayout(3,3,1,2));
		jp4.add(jla1);
		jp4.add(jte);
		jp4.add(jb2);
		jp4.add(jla2);
		jp4.add(jpa);
		jp4.add(jla3);
		jp4.add(jra1);
		jp4.add(jra2);
		jp4.add(jla4);

		jp1.add(jb1);
		jp2.add(jta);
		jp3.add(jb3);
		jp3.add(jb4);
		jp3.add(jb5);
		
		this.add(jp1,BorderLayout.NORTH);
		this.add(jp2,BorderLayout.CENTER);
		this.add(jp3,BorderLayout.SOUTH);
		
		
		this.setSize(400, 290);
		this.setVisible(true);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setLocation(450, 120);
		
	}
	
	public static void main(String[] args) {
		Demo121 de=new Demo121();
	}
}

运行结果:
在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大菜彩

家人们鼓励鼓励!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值