//jdk1.3
//applet code=keyvalue width=100 height=50/applet
//通常applet程序是添加在HTML页里的,而在JAVA源程序中添加以上一行以后,就可
//以在命令行输入appletviewer keyvalue.java来查看结果了.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class main extends Applet implements KeyListener { //定义接口类型为KeyListener
TextField txt=new TextField(10);
Label lab=new Label("键盘对应ASCII码"); //Enter对应值为10
//Button btn=new Button("excu");
public void init() { //初始化
add(txt);
add(lab);
//add(btn);
txt.addKeyLis...[ 查看全文 ]