package ChatSys.client.view;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import ChatSys.client.action.RegisterFrameAction;
import ChatSys.common.gui.MyJPanel;
public class RegisterFrame extends JFrame {
private static final long serialVersionUID = 1L;
private JLabel nameWarn_label,pswWarn_label,againWarn_label,nickNameWarn_label;
private JTextField nameField,nickNameField;
private JPasswordField pswField,againField;
private JButton iconLoadBu,okBu,exitBu;
private MyJPanel iconPanel,enlargeIconPanel;
private JTextArea showInfoArea ;
private JPanel regPanel , showInfoPanel;
private RegisterFrameAction register = new RegisterFrameAction(this);
private ClientLoginFrame selfFrame;
/****************
* 构造器,传入线程
* @param clientThread
*/
public RegisterFrame(ClientLoginFrame selfFrame){
this.selfFrame = selfFrame;
//初始化属性
this.setTitle("注册");
this.setSize(550,500);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation((d.width-550)/2,(d.height-500)/2);
this.createUI();
this.setVisible(true);
actionFrame();
}
private void actionFrame() {
okBu.addActionListener(register);
exitBu.addActionListener(register);
iconLoadBu.addActionListener(register);
}
/******************
* 创建界面UI
*/
public void createUI(){
this.setLayout(null);
//创建regPanel
regPanel = new JPanel();
regPanel.setLayout(null);
regPanel.setBounds(0, 0, 550, 500);
//账号
JLabel name_label = new JLabel("账号:");
name_label.setBounds(40, 15, 50, 25);
nameField = new JTextField();
nameField.setBounds(95, 15, 185, 25);
nameWarn_label = new JLabel("( 账号只能由数字组成,最大长度为10 )");
nameWarn_label.setForeground(Color.BLUE);
nameWarn_label.setBounds(285, 15, 240, 25);
//昵称
JLabel nickName_label = new JLabel("昵称:");
nickName_label.setBounds(40, 50, 50, 25);
nickNameField = new JTextField(5);
nickNameField.setBounds(95, 50, 185, 25);
nickNameWarn_label = new JLabel("( 昵称可为汉字或数字,最大长度为15 )");
nickNameWarn_label.setForeground(Color.blue);
nickNameWarn_label.setBounds(285, 50, 240, 25);
//密码
JLabel psw_label = new JLabel("密码:");
psw_label.setBounds(40, 85, 50, 25);
pswField = new JPasswordField();
pswField.setBounds(95, 85, 185, 25);
pswWarn_label = new JLabel("( 密码可为汉字或数字,最大长度为10 )");
pswWarn_label.setForeground(Color.BLUE);
pswWarn_label.setBounds(285, 85, 240, 25);
//密码确认
JLabel again_label = new JLabel("确认密码:");
again_label.setBounds(15, 120, 60, 25);
againField = new JPasswordField();
againField.setBounds(95, 120, 185, 25);
againWarn_label = new JLabel("( 两次密码输入需相同 )");
againWarn_label.setBounds(285, 120, 240, 25);
againWarn_label.setForeground(Color.BLUE);
//头像预览和头像放大预览
iconPanel = new MyJPanel(new ImageIcon("Image\\QQ头像\\default.gif"));
iconPanel.setBounds(350, 200, 40, 40);
enlargeIconPanel = new MyJPanel(new ImageIcon("Image\\QQ头像\\default.gif"));
enlargeIconPanel.setBounds(320, 260, 100, 100);
//头像选择提示,本地上传按钮
JLabel icon_label = new JLabel("点击下列图片选择头像");
icon_label.setForeground(Color.blue);
icon_label.setBounds(15, 190, 135, 25);
iconLoadBu = new JButton("本地上传头像");
iconLoadBu.setName("iconLoadBu");
iconLoadBu.setBounds(150, 190, 115, 25);
//头像
JButton bu = new JButton(new ImageIcon("Image\\QQ头像\\default.gif"));
bu.setBorder(null);
bu.setBounds(30, 230, 40, 42);
regPanel.add(bu);
for(int i=1;i<6;i++){
for(int j=0;j<4;j++){
JButton button = new JButton(new ImageIcon("Image\\QQ头像\\头像"+(j*5+i-1)+".gif"));
button.setBorder(null);
button.addActionListener(register);
button.setBounds(30+(i-1)*50, 230+j*50, 40, 40);
regPanel.add(button);
}
}
//提交 取消
okBu = new JButton("确定");
okBu.setName("okBu");
okBu.setBounds(310, 400, 80, 25);
exitBu = new JButton("退出");
exitBu.setName("exitBu");
exitBu.setBounds(400, 400, 80, 25);
//添加
regPanel.add(name_label);
regPanel.add(nameField);
regPanel.add(nameWarn_label);
regPanel.add(nickName_label);
regPanel.add(nickNameField);
regPanel.add(nickNameWarn_label);
regPanel.add(psw_label);
regPanel.add(pswField);
regPanel.add(pswWarn_label);
regPanel.add(again_label);
regPanel.add(againField);
regPanel.add(againWarn_label);
regPanel.add(iconPanel);
regPanel.add(enlargeIconPanel);
regPanel.add(icon_label);
regPanel.add(iconLoadBu);
regPanel.add(okBu);
regPanel.add(exitBu);
regPanel.setVisible(true);
//创建showInfoPanel
showInfoPanel = new JPanel();
showInfoPanel.setLayout(null);
showInfoPanel.setBounds(0, 0, 550, 500);
//创建showInfoArea 注册成功后显示输入信息
showInfoArea = new JTextArea();
showInfoArea.setWrapStyleWord(true);
showInfoArea.setEditable(false);
showInfoArea.setVisible(false);
showInfoArea.setBounds(0, 0, 550, 500);
showInfoPanel.add(showInfoArea);
showInfoPanel.setVisible(false);
//Frame ADD JPanel
this.add(regPanel);
this.add(showInfoPanel);
}
public JPasswordField getAgainField() {
return againField;
}
public JTextField getNameField() {
return nameField;
}
public JTextField getNickNameField() {
return nickNameField;
}
public JPasswordField getPswField() {
return pswField;
}
public MyJPanel getIconPanel() {
return iconPanel;
}
public MyJPanel getEnlargeIconPanel() {
return enlargeIconPanel;
}
public ClientLoginFrame getSelfFrame() {
return selfFrame;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
仿qq登陆,所用的技术有socket通信和jdbc数据库访问技术
共126个文件
gif:54个
class:32个
java:27个
5星 · 超过95%的资源 需积分: 10 22 下载量 83 浏览量
2011-11-09
14:22:48
上传
评论
收藏 1.32MB RAR 举报
温馨提示
使用客户端/服务器模式,在客户端对服务器发起请求,服务器处理请求,根据客户端发送过来的消息,对数据库进行访问,进行密码验证,若成功则返回TRUE,否则返回FALSE。
资源推荐
资源详情
资源评论
收起资源包目录
仿qq登陆,所用的技术有socket通信和jdbc数据库访问技术 (126个子文件)
RegisterFrame.class 6KB
RegisterFrameAction.class 5KB
DBPools.class 5KB
LoginFrameActionListener.class 4KB
ClientLoginFrame.class 4KB
Logger.class 4KB
DBConnectionUtil.class 4KB
LoginDao.class 3KB
RegisterServer.class 3KB
UserVO.class 3KB
MyJFrame.class 2KB
MyTableModel.class 2KB
RegisterThread.class 2KB
LoginThread.class 2KB
FrameProperties.class 2KB
RegisterDao.class 2KB
GBC.class 1KB
MyJFrame$2.class 1KB
InitResource.class 1KB
RegisterServerAction.class 1KB
DateUtils.class 1KB
FriendVO.class 1KB
ValidatorComponent.class 1KB
MyJPanel.class 1KB
MyJFrame$1.class 1003B
ClientLoginFrame$1.class 777B
RegisterService.class 597B
LoginService.class 579B
StartServer.class 493B
StartClient.class 433B
ConstantsPattern.class 349B
MainFrame.class 303B
.classpath 343B
t.gif 3KB
s.gif 3KB
q.gif 3KB
头像19.gif 3KB
n.gif 3KB
r.gif 2KB
p.gif 2KB
头像17.gif 2KB
k.gif 2KB
头像14.gif 2KB
o.gif 2KB
头像18.gif 2KB
l.gif 2KB
f.gif 2KB
h.gif 2KB
头像13.gif 2KB
d.gif 2KB
头像12.gif 2KB
a.gif 2KB
default.gif 2KB
c.gif 2KB
头像15.gif 2KB
e.gif 2KB
j.gif 2KB
8.gif 2KB
3.gif 2KB
1.gif 2KB
5.gif 2KB
6.gif 2KB
头像11.gif 2KB
b.gif 2KB
头像7.gif 2KB
g.gif 2KB
m.gif 2KB
4.gif 2KB
头像2.gif 2KB
头像1.gif 2KB
7.gif 2KB
头像10.gif 2KB
i.gif 2KB
头像16.gif 2KB
2.gif 2KB
9.gif 2KB
头像9.gif 2KB
头像5.gif 2KB
头像8.gif 2KB
头像6.gif 2KB
头像3.gif 1KB
头像4.gif 1KB
middle.gif 976B
right.gif 961B
down.gif 952B
add.GIF 326B
search.GIF 239B
ojdbc14.jar 1.12MB
OfficeLnFs_2.7.jar 102KB
class81-util.jar 14KB
RegisterFrame.java 6KB
DBPools.java 5KB
RegisterServer.java 5KB
RegisterFrameAction.java 4KB
Logger.java 3KB
ClientLoginFrame.java 3KB
LoginFrameActionListener.java 3KB
UserVO.java 3KB
DBConnectionUtil.java 3KB
GBC.java 2KB
共 126 条
- 1
- 2
资源评论
- wanjie你好每一天2012-10-15代码很完整。能够直接使用。
- sinat_321221332015-11-04代码很完整,不错
- LOITA32012-12-27很好,可以直接使用。很强大
潜心修炼的小菜鸟
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功