📄 loginapplet.java.bak
字号:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class LoginApplet extends Applet implements ActionListener
{
Button b1;
TextField tf1,tf2;
public void init()
{
Label t1,t2,t3;
Choice c1;
setBackground(Color.white);
setLayout(new FlowLayout(FlowLayout.LEFT));
t1 = new Label("邮箱");
tf1 = new TextField("用户名",10);
t2 = new Label("@");
t2.setFont(new Font("Dialog",0,18));
c1 = new Choice();
c1.addItem("263.net");
t3 = new Label("密码");
tf2 = new TextField("********",10);
b1 = new Button("登录");
b1.addActionListener(this); //为按钮注册事件监听程序
tf2.addActionListener(this); //为文本行注册事件监听程序
add(t1);
add(tf1);
add(t2);
add(c1);
add(t3);
add(tf2);
add(b1);
}
public void actionPerformed(ActionEvent e)
{
if (e.getSource()==b1) //单击按钮时
{}
if (e.getSource()==tf2) //文本行中按〈回车〉时
{}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -