| 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
Bartender
Joined: Aug 16, 2005
Posts: 12909
|
|
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: 32651
|
|
|
Please read this; it's "thank you" not "ty" please.
|
 |
 |
|
|
subject: Problem with "abstract class
|
|
|