eclipse后端编写QQ模拟界面

package com.hj.oop;

import java.awt.Font; import java.awt.Image; import java.util.Scanner;

import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField;

// 复选框 JCheckBox jc = new JCheckBox("记住密码"); //编译字体 jc.setFont(new Font("楷体",0,15)); // 默认选择 jc.setSelected(true); jc.setBounds(135, 230, 90, 20); jf.getContentPane().add(jc);

JCheckBox jc1 = new JCheckBox("自动登录"); jc1.setFont(new Font("楷体", 0, 15)); jc1.setBounds(250, 230, 90, 20); jf.getContentPane().add(jc1); // 安全登录 按钮 JButton jbs = new JButton("登录"); jbs.setFont(new Font("黑体加粗",0,18)); jbs.setBounds(140, 255, 195, 35); jf.getContentPane().add(jbs); // 本文 JLabel ja = new JLabel("注册账号"); ja.setFont(new Font("楷体", 0, 13)); ja.setBounds(340, 170, 120, 25); jf.getContentPane().add(ja);

JLabel ja1 = new JLabel("找回密码"); ja1.setFont(new Font("楷体", 0, 13)); ja1.setBounds(340, 205, 120, 25); jf.getContentPane().add(ja1); // 换log Image imgs = jf.getToolkit().createImage("image/99.jpg"); jf.setIconImage(imgs);

// 添加图片 ImageIcon im = new ImageIcon("image/116.jpg");//图片名称 JLabel bs = new JLabel(im); //图片大小即方位 bs.setBounds(0, 0, 430, 150); jf.getContentPane().add(bs);

ImageIcon ims = new ImageIcon("image/f.png"); JLabel bsa = new JLabel(ims); bsa.setBounds(20, 132, 100, 150); jf.getContentPane().add(bsa); ImageIcon ima = new ImageIcon("image/d.png"); JLabel bsb = new JLabel(ima); bsb.setBounds(20, 230, 30, 110); jf.getContentPane().add(bsb); ImageIcon imb = new ImageIcon("image/e.png"); JLabel bsc = new JLabel(imb); bsc.setBounds(20, 230, 770, 110); jf.getContentPane().add(bsc);

// 设置边框大小 jf.setSize(430, 330); // 关闭窗口 jf.setDefaultCloseOperation(3); // 居中 jf.setLocationRelativeTo(null); // 不能扩大 jf.setResizable(false); // 边框初始值 jf.setLayout(null);

// 显示边框 jf.setVisible(true); }

}

经验分享 程序员 微信小程序 职场和发展