File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Problem with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with "abstract class" Watch "Problem with "abstract class" New topic
Author

Problem with "abstract class

Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
Hi i'm trying to use netbeans for using the system that draw gui without writing code, i did my dialog, now i'm preparing classes but i get an error



Error desktopapplication1.TbEvent is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener TbEvent.java 16


what can i do?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Your class TbEvent implements the interface ActionListener.

When you have a (non-abstract) class that implements an interface, you are required to implement all the methods in the interface. One of the methods in interface ActionListener is called actionPerformed, and it takes a java.awt.event.ActionEvent as an argument. You didn't implement that method in your class.

Add a method to class TbEvent:



Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
Jesper Young wrote:Your class TbEvent implements the interface ActionListener.

When you have a (non-abstract) class that implements an interface, you are required to implement all the methods in the interface. One of the methods in interface ActionListener is called actionPerformed, and it takes a java.awt.event.ActionEvent as an argument. You didn't implement that method in your class.

Add a method to class TbEvent:



ty a lot
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38033
    
  22
Please read this; it's "thank you" not "ty" please.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with "abstract class
 
Similar Threads
Desktop.Action.EMAIL
Dialogs
Jtable and database results
problem with insert and select
NullPtrException when reading JTextField