jQuery in Action, 3rd edition
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error while implementing ActionListener" Watch "Error while implementing ActionListener" New topic

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


Joanne Neal

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

divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87
Thanks for your help!!
I agree. Here's the link: http://aspose.com/file-tools
subject: Error while implementing ActionListener
It's not a secret anymore!