请大侠帮忙看看,下面的程序无法执行
import java.awt.*;
import java.awt.event.*;
class MyWindow extends Frame implements ActionListener
{
TextField text1,text2,text3;
MyWindow()
{
setLayout(new FlowLayout());
text1=new TextField(8);
text1=new TextField(8);
text1=new TextField(15);
add(text1);
add(text2);
add(text3);
setBounds(100,100,200,150);
text1.addActionListener(this);
text2.addActionListener(this);
setVisible(true);
validate();
}
//对事件处理方法
public void actionPerformed(ActionEvent e)
{
if (e.getSource()==text1)
{
String word=text1.getText();
if(word.equals("boy"))
{
text3.setText("男孩");
}
else if(word.equals("girl"))
{
text3.setText("女孩");
}
else {text3.setText("没有该单词!");
}
}
else if (e.getSource()==text2)
{
String word=text2.getText();
if(word.equals("男孩"))
{
text3.setText("boy");
}
else if(word.equals("女孩"))
{
text3.setText("girl");
}
else {text3.setText("没有该单词!");
}
}
}
}
public class Eve {
public static void main(String args[])
{
MyWindow win=new MyWindow();
}
}