请高手指点一下
//Demonstrate text field.import java.awt.*;
import java.awt.evevt.*;
import java.applet.*;
/*
<applet code="TextFieldDemo" width=380 height=150>
</applet>
*/
public class TextFieldDemo extends applet
implements ActionListener {
TextField name,pass;
public void init(){
Label namep=new Label("Name:",Label.RIGHT);
Label passp=new Label("Password:",Label.RIGHT);
name=new TextField(12);
name=new TextField(8);
pass.setEchoChar('$');
add(namep);
add(name);
add(passp);
add(pass);
//register to receive action events
name.addActionListener(this);
pass.addActionListener(this);
}
//User pressed Enter.
public void actionPerformed(ActionEvent ae){
repaint();
}
public void paint(Graphics g){
g.drawString("Name:"+name.getText(),6,60);
g.drawString("Selected text in name:"+name.getSelectedText(),6,80);
g.drawString("Password:"+pass.getText(),6,100);
}
}
书上的例子 为什么调试有错误
显示一个错误:无法找到类型"applet"
新手求教 请大家帮帮忙啊