本人实在是不知道怎么回事,求助高手
import java.applet.*;import java.awt.*;import java.awt.event.*;public class rain05 extends Applet implements ActionListener
{ TextField text1,text2,text3;
public void init()
{ text1=new TextField(10);
text2=new TextField(10);
text3=new TextField(30);
add(text1);add(text2);add(text3);
text1.addActionListener(this);
text2.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{ if(e.getSource()==text1)
{ String word=text1.getText();
if(word.equals("boy"))
{ text3.setText("handsome");
}
else if(word.equals("girl"))
{text.setText("beautiful");
}
else{
text3.setText("have no this word");}
}
else if(e.getSource()==text2)
{ String word=text2.getText();
if(word.equals("goodboy"))
{ text3.setText("myself");}
else if(word.equals("badgirl"))
{ text3.setText("mygirl");}
else {
text3.setText("have no this word");}
}
}
}
这是我照书抄的程序,可编译不通过
竟然有100 个错误,小弟真是心急啊