package com.qq.client.view; import javax.swing.; import java.awt.; import java.awt.event.*; import java.net.NoRouteToHostException; import java.security.acl.Group; public class QqClientLogion extends JFrame{
//定義組鍵
//北邊需要的組件
JLabel jla1;
//中間需要的組件
JPanel jp2,jp3,jp4;
JTabbedPane jtp;
JLabel jla2_jla1,jla2_jla2,jla2_jla4,jla2_jla3;
JButton jp2_jb1;
JTextField jtf;
JPasswordField jpw;
JCheckBox jp2_jcb1,jp2_jcb2;
//南邊需要的組件
JPanel jp1;JButton jp1_jb1,jp1_jb2,jp1_jb3;
public static void main(String[] args) {// TODO Auto-generated method stubQqClientLogion qq = new QqClientLogion();
}public QqClientLogion() {//處理北邊jla1 = new JLabel(new ImageIcon("image/tou.gif"));//處理南邊jp1 = new JPanel();jp1_jb1 = new JButton(new ImageIcon("image/denglu.gif"));jp1_jb2 = new JButton(new ImageIcon("image/quxiao.gif"));jp1_jb3 = new JButton(new ImageIcon("image/xiangdao.gif"));jp1.add(jp1_jb1);jp1.add(jp1_jb2);jp1.add(jp1_jb3);//處理中間jp2 = new JPanel(new GridLayout(3, 3));jla2_jla1 = new JLabel("QQ號碼",JLabel.CENTER);jla2_jla2 = new JLabel("QQ密碼",JLabel.CENTER);jla2_jla3 = new JLabel("忘記密碼",JLabel.CENTER);//設置前景色jla2_jla3.setForeground(Color.blue);jla2_jla4 = new JLabel("申請密碼保護",JLabel.CENTER);jp2_jb1 = new JButton(new ImageIcon("image/clear.gif"));jtf = new JTextField();jpw = new JPasswordField();jp2_jcb1 = new JCheckBox("隱身登陸");jp2_jcb2 = new JCheckBox("記住密碼");jp2.add(jla2_jla1);jp2.add(jtf);jp2.add(jp2_jb1);jp2.add(jla2_jla2);jp2.add(jpw);jp2.add(jla2_jla3);jp2.add(jp2_jcb1);jp2.add(jp2_jcb2);jp2.add(jla2_jla4);//選項卡jtp = new JTabbedPane();jtp.add("QQ號碼", jp2);//創建jp3 = new JPanel();jtp.add("手機號碼", jp3);jp4 = new JPanel();jtp.add("電子郵件", jp4);//加入this.add(jtp,"Center");this.add(jp1,"South");this.add(jla1,"North");this.setTitle("QQ登陸");this.setSize(340,240);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setVisible(true);}