package com.qq.login;
/**
* QQ登录界面的设计
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import com.qq.MyClient.MyClient;
import com.qq.user.user;
JLabel jlb1,jlb2,jlb3,jlb4,jlb5
;
public qq_login() {
jb1.addActionListener(this);jb1.setActionCommand("a");
jb2.addActionListener(this);jb2.setActionCommand("b");
jb3.addActionListener(this);jb3.setActionCommand("c");
//处理中部
jlb4.
setForeground(Color.
BLUE);
jp1.add(jlb1);
jp1.add(jtf);
jp1.add(jlb3);
jp1.add(jlb2);
jp1.add(jpf);
jp1.add(jlb4);
jtp.add("QQ号码",jp1);
jtp.add("手机号码",jp3);
jtp.add("电子邮件",jp4);
//处理南部
jp2.add(jb1);
jp2.add(jb2);
jp2.add(jb3);
this.setTitle("QQ2009");
this.
setIconImage((new ImageIcon("qq.jpg")).
getImage());
this.add(jtp);
this.setSize(345,220);
this.
setDefaultCloseOperation(JFrame.
EXIT_ON_CLOSE);
this.setVisible(true);
}
public static void main
(String[] args
) {
new qq_login();
}
@Override
if("a".equals(e.getActionCommand())){
user u=new user();
u.setUserId(jtf.getText());
u.
setUserPd(new String(jpf.
getPassword()));
if(new MyClient().fistLogin(u)){
new qq_FriendList(u.getUserId());
this.dispose();
}else{
}
}else if("b".equals(e.getActionCommand())){
}else if("c".equals(e.getActionCommand())){
Desktop ds=Desktop.getDesktop();
try {
ds.browse(new URI("http://tts6.tarena.com.cn"));
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}