错误信息:'void' type not allowed here!! 帮我看看
原程序如下
import java.awt.*;
import java.awt.event.*;
public class Button_test{
public static void main(String[] args){
Frame f=new Frame("Button test");
f.setLayout(new FlowLayout());
f.add(new Button("test button").addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
System.exit(0);
}
}
)
) ;
}
}
错误信息如题,谢谢各位了!!应该怎么改呢???
----------
我是菜鸟!请多关照!!