public interface ActionListerner
{
void actionPerformed(ActionEvent event);
} //这个接口有什么用啊...
又没有几个类要用,用得着多态吗?
Class MyListenner implements ActionListener
{
public void actionPerformed(ActionEvent event)
{
//在每次定时器事件中执行此动作
}
}
MyListerner listerner = new MyListener();
Timer t = new Timer(interval,listener);
t.start();