当我尝试添加第二个动作侦听器时出现错误。我设置了两个不同的 JButton,其中一个工作正常,但是当我尝试为第二个添加动作侦听器时,我收到以下错误:
is not abstract and does not override abstract method actionPerformed(ActionEvent) in ActionListener
next.addActionListener(new ActionListener (){
这是两个动作监听器的代码。
next.addActionListener(new ActionListener (){
public void preformedAction(ActionEvent e){
}
});
close.addActionListener(new ActionListener (){
public void actionPerformed(ActionEvent event){
frame.dispose(); //Closes Window
}//End ActionPreformed
});//End Of Close Action
两个按钮是“下一步”和“关闭”