📄 a.java
字号:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.util.*;
import java.awt.geom.*;
import javax.swing.*;
class denglu extends Frame implements ActionListener
{
ImageIcon i1;
Label L1,L2,L3,L4,L5,L6,L7,L8,L9;
JLabel j1;
Choice c1,c2,c3;
Checkbox c11,c12;
Button b1,b2,b3,b4,b5,b6,b7,b8,b9;
JPasswordField t1;
TextField t2;
xinjian p1;
xinjian1 p11;
static int x=0,y=0,w,h;
public denglu()
{super("QQ用户登录");
// static int x=0,y=0,w,h;
setLayout(null);
addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){dispose();System.exit(0);}});
L1=new Label("QQ号码:");L2=new Label("QQ密码:");
L3=new Label("忘记密码");L4=new Label("申请密码保护");
L5=new Label("<-请选择登陆方式");
L6=new Label("手机号码:");L7=new Label("邮箱号码:");L8=new Label("移动QQ活动");L9=new Label("手机取回密码");
t2=new TextField("<请在这儿输入QQ号码> ");
c1=new Choice();
c1.add("<请在这儿输入QQ号码> ");
c1.addItem("");c1.addItem("");c1.addItem("");c1.addItem("");
c2=new Choice();
c2.add("<请在这儿输入手机号码>");
c2.addItem("");c2.addItem("");c2.addItem("");c2.addItem("");
c3=new Choice();
c3.add("<请在这儿输入E-mail> ");
c3.addItem("");c3.addItem("");c3.addItem("");c3.addItem("");
i1=new ImageIcon("a.gif");
j1=new JLabel(i1);
t1=new JPasswordField();
p1=new xinjian();
p11=new xinjian1();
b1=new Button ("QQ号码");b2=new Button ("手机号码");b3=new Button ("电子邮箱");b4=new Button ("清除");
b5=new Button ("登录"); b6=new Button ("取消");b7=new Button ("注册向导");b8=new Button("手机登录向导");b9=new Button("绑定向导");
b2.addActionListener(this);b1.addActionListener(this);
b3.addActionListener(this);b6.addActionListener(this);
b7.addActionListener(this);b5.addActionListener(this);
c11=new Checkbox("记住密码");
c12=new Checkbox("隐身登录");
setBounds(340,255,367,248);
w=getSize().width; h=getSize().height;
x=w/19; y=h/13;
add(L1);add(L2);add(L3);add(L4);add(L5);
add(t2);add(c11);add(c12);add(t1);
add(b1);add(b2);add(b3);add(b4);add(b5);add(b6);add(b7);add(j1);
add(j1);
j1.setBounds(0,y,w,3*y);
b1.setBounds(x,3*y,3*x,y);b2.setBounds(4*x,3*y,4*x,y);b3.setBounds(8*x,3*y,4*x,y);L5.setBounds(13*x,3*y,5*x,y);
L1.setBounds(2*x,5*y,3*x,y);t2.setBounds(6*x,5*y,8*x,y);b4.setBounds(15*x,5*y,3*x,y);
L2.setBounds(2*x,7*y,3*x,y);t1.setBounds(6*x,7*y,8*x,y);L3.setBounds(15*x,7*y,3*x,y);
c11.setBounds(6*x,9*y,4*x,y);c12.setBounds(11*x,9*y,4*x,y);
L4.setBounds(x,11*y,5*x,y);b5.setBounds(6*x,11*y,3*x,y);
b6.setBounds(10*x,11*y,3*x,y);b7.setBounds(14*x,11*y,4*x,y);
setVisible(true);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==b2){ remove(L1);remove(L6);remove(L7);remove(L4);remove(L8);remove(t2);remove(c2);remove(c3);add(L8);add(L6);add(c2);L6.setBounds(2*x,5*y,3*x,y);L8.setBounds(x,11*y,5*x,y);c2.setBounds(6*x,5*y,8*x,y);}
if(e.getSource()==b1){ remove(L1);remove(L6);remove(L7);remove(L4);remove(L8);remove(t2);remove(c2);remove(c3);add(L4);add(L1);add(t2);L1.setBounds(2*x,5*y,3*x,y);L4.setBounds(x,11*y,5*x,y);c1.setBounds(6*x,5*y,8*x,y);}
if(e.getSource()==b3){ remove(L1);remove(L6);remove(L7);remove(L4);remove(L8);remove(t2);remove(c2);remove(c3);add(L4);add(L7);add(c3);L7.setBounds(2*x,5*y,3*x,y);L4.setBounds(x,11*y,5*x,y);c3.setBounds(6*x,5*y,8*x,y);}
if(e.getSource()==b6){ dispose();System.exit(0);}
if(e.getSource()==b7){ this.setVisible(false);p1.setVisible(true);}
if(e.getSource()==b5){ this.setVisible(false);p11.setVisible(true);}
}
}
class xinjian extends Frame implements ActionListener,ItemListener{
ImageIcon i2,i1;
JLabel j2,j1;
Button b1,b2,b3;
CheckboxGroup check1,check2;
Checkbox c1,c2,c3,c4,c5;
Label l1,l2,l3;
TextField t1,t2;
static int x=0,y=0,w,h;
public xinjian(){
super("QQ注册向导 .....");
addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){dispose();System.exit(0);}});
setLayout(null);
i2=new ImageIcon("b.gif");i1=new ImageIcon("b1.gif");
b1=new Button("上一步");b2=new Button("下一步");b3=new Button("返回登录框");
b2.addActionListener(this);b1.addActionListener(this);
b3.addActionListener(this);
check1=new CheckboxGroup();
check2=new CheckboxGroup();
c1=new Checkbox("新申请一个QQ号码",check1,true);
c3=new Checkbox("直接申请QQ行号码",check2,true);
c4=new Checkbox("申请靓号地带号码",check2,false);
c5=new Checkbox("通过网站申请免费QQ号码",check2,false);
c2=new Checkbox("使用已有的QQ号码",check1,false);
c1.addItemListener(this);
l1=new Label("用户名:");l2=new Label("密码:");
l3=new Label("提示:你可以在上面输入已有的QQ号");
t1=new TextField();t2=new TextField();
j2=new JLabel(i2);
j1=new JLabel(i1);
setBounds(340,255,452,357);
w=getSize().width; h=getSize().height;
x=w/36; y=h/24;
add(j2);
add(c1);add(c2);add(c3);add(c4);add(c5);
add(l1);add(l2);add(l3);
add(t1);add(t2);
add(b1);add(b2);add(b3);
j2.setBounds(x,4*y,8*x,20*y);
c1.setBounds(14*x,4*y,10*x,y);
c3.setBounds(16*x,6*y,10*x,y);
c4.setBounds(16*x,8*y,10*x,y);
c5.setBounds(16*x,10*y,13*x,y);
c2.setBounds(14*x,12*y,10*x,y);
l1.setBounds(16*x,14*y,5*x,y);t1.setBounds(21*x,14*y,10*x,y);
l2.setBounds(16*x,16*y,3*x,y);t2.setBounds(21*x,16*y,10*x,y);
l3.setBounds(16*x,18*y,17*x,y);
b1.setBounds(16*x,22*y,5*x,y);b2.setBounds(21*x,22*y,5*x,y);b3.setBounds(27*x,22*y,6*x,y);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==b1){this.setVisible(false);denglu dl=new denglu();}
if(e.getSource()==b3){this.setVisible(false);denglu dl=new denglu();}
if(e.getSource()==b2){removeAll();add(j1);j1.setBounds(0,0,w,h);}
}
public void itemStateChanged(ItemEvent e){
}
}
class xinjian1 extends Frame implements ActionListener,ItemListener{
ImageIcon i1,i2,i3,i11,i12,i13,i14,i15,i21,i22,i23,i24,i25;
JButton b1,b2,b3,b4,b5,b6,b7,b8,b9;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15,l16,l17;
static int x=0,y=0,w,h;
public xinjian1(){
super("QQ2004");
addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){dispose();System.exit(0);}});
setLayout(null);
i1=new ImageIcon("c.bmp");
i11=new ImageIcon("d.bmp");i12=new ImageIcon("g.gif");i13=new ImageIcon("h.gif");
i14=new ImageIcon("i.gif");i15=new ImageIcon("j.gif");
i21=new ImageIcon("h.gif");i22=new ImageIcon("l.gif");i23=new ImageIcon("m.gif");
i24=new ImageIcon("n.gif");i25=new ImageIcon("o.gif");
l1=new JLabel(i1);l2=new JLabel("34197875");l3=new JLabel("您没有新邮件");
l4=new JLabel("我的好友(6)");l5=new JLabel();l6=new JLabel();
l7=new JLabel();l8=new JLabel();l9=new JLabel();
l10=new JLabel();l11=new JLabel();l12=new JLabel();l13=new JLabel();
l14=new JLabel();l15=new JLabel();l16=new JLabel();l17=new JLabel();
b1=new JButton(i11);b2=new JButton(i12);b3=new JButton(i13);
b4=new JButton(i14);b5=new JButton(i15);b6=new JButton("QQ好友");
b7=new JButton("手机好友");b8=new JButton("群/校友录");b9=new JButton("最近联系人");
setBounds(900,100,100,600);
w=getSize().width; h=getSize().height;
x=w/6; y=h/29;
add(l1);add(l2);add(l3);
add(b1);add(b2);add(b3);add(b4);add(b5);
add(b6);add(l4);
add(l5);add(l6);add(l7);add(l8);add(l9);add(l10);
add(b7);add(b8);add(b9);
add(l17);
l1.setBounds(0,2*y,x,2*y);l2.setBounds(x,2*y,6*x,y);l3.setBounds(x,3*y,5*x,y);
b1.setBounds(0,4*y,x,2*y);b2.setBounds(0,6*y,x,2*y);b3.setBounds(0,8*y,x,2*y);b4.setBounds(0,10*y,x,2*y);b5.setBounds(0,12*y,x,2*y);
b6.setBounds(x,4*y,6*x,y);l4.setBounds(x,5*y,6*x,y);
l5.setBounds(2*x,7*y,2*x,2*y);l6.setBounds(2*x,10*y,2*x,2*y);l7.setBounds(2*x,13*y,2*x,2*y);l8.setBounds(2*x,16*y,2*x,2*y);l9.setBounds(2*x,19*y,2*x,2*y);l10.setBounds(2*x,22*y,2*x,2*y);
b7.setBounds(x,25*y,5*x,y);b8.setBounds(x,26*y,5*x,y);b9.setBounds(x,27*y,5*x,y);
l17.setBounds(0,28*y,6*x,2*y);
}
public void actionPerformed(ActionEvent e){
}
public void itemStateChanged(ItemEvent e){
}
}
class a{
static denglu fr;
public static void main(String args[]){
fr=new denglu();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -