aspose file tools*
The moose likes Beginning Java and the fly likes Error while implementing ActionListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error while implementing ActionListener" Watch "Error while implementing ActionListener" New topic
Author

Error while implementing ActionListener

divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87
I want to implement an ActionListener. But when I am running it. Error appears

D:\JavaProg\head first\chap-12\SimpleGui1B.java:4: SimpleGui1B is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
public class SimpleGui1B implements ActionListener
^
1 error

Tool completed with exit code 1

My Code is:

import javax.swing.*;
import java.awt.event.*;

public class SimpleGui1B implements ActionListener
{
JButton button;

}

My java version is j2sdk1.4.2_13

Thanks,
Divya


Divya
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3679
    
  16
A class that implements ActionListener has to have an actionPerformed method. See the Javadoc for details.


Joanne
divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87
Thanks for your help!!
 
Consider Paul's rocket mass heater.
 
subject: Error while implementing ActionListener