为啥我用eclipse运行时,没有任何反应!是不是缺少插件还是什么东西??
package com.hu.Jfourteen_four;
import java.awt.*;
import java.awt.event.*;
public class reMulEvent extends WindowAdapter implements ActionListener
{
Frame myFrame;
Label myLabel;
TextField myText;
Button mybtn;
public void AWTFrame()
{
myFrame=new Frame("AWT使用示例");
myLabel=new Label("世界,你好!");
myText=new TextField("请在这里填入内容");
mybtn=new Button("清空内容");
myFrame.add(myLabel);
myFrame.add(myText);
myFrame.add(mybtn);
myFrame.setSize(200,200);
myFrame.setLayout(new FlowLayout());
//add window focus listener,the event is itself;
myFrame.setVisible(true);
myFrame.addWindowFocusListener(this);
mybtn.addActionListener(this);
}
public void windowClosing(WindowEvent e)
{
myFrame.dispose();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==mybtn)
myText.setText(null);
}
public static void main(String[] args)
{
new reMulEvent();
}
}