Results 1 to 3 of 3
  1. #1
    Theman is offline Member
    Join Date
    May 2007
    Rep Power

    Default method not abstract, does not override actionperformed method.

    i am completely new to java, so this might be a very basic question.

    i am trying to make this applet that a user can define red, blue and green in numbers and then the number displays as the applets background color.

    but when i compile it gives this error message

    E:\java\ch6\ myColor is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
    public class myColor extends Applet implements ActionListener
    Last edited by Theman; 05-08-2007 at 07:02 AM.

  2. #2
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Rep Power


    The error is very direct. It says your class mycolor is implementing an interface ActionListener. According to the java principles " if a class implements an interface the class has to implement all the methods of the interface ,Or else the class has to be an abstract class.

    Confusing ..............

    To solve the error in your class add a method inside the color.
    Java Code:
    public void actionPerformed(java.awt.event.ActionEvent){

    But this is a temporary solution. I would suggest you to do 2 things.

    1) Read OOps concepts of Java

    2)Use some editor for Java like Eclipse. Eclipse blog

  3. #3
    dwargkiller is offline Member
    Join Date
    Mar 2010
    Rep Power

    Default ActionListener

    I encountered this error about twenty minutes ago, trying to compile my program. In my case, it was due to the fact that I had removed any implementation of ActionListener in the program, but it was still implemented in the

    Java Code:
    public class x extends JPanel implements ActionListener
    I simply removed the implements ActionListener and it worked for me. Although, if you need to use ActionListener, this solution will of course not work.


Similar Threads

  1. Replies: 6
    Last Post: 10-27-2008, 01:25 AM
  2. Method Help
    By pringle in forum New To Java
    Replies: 4
    Last Post: 04-16-2008, 02:23 PM
  3. clone method
    By javaplus in forum New To Java
    Replies: 2
    Last Post: 01-30-2008, 10:47 AM
  4. method calling?
    By frejon26 in forum New To Java
    Replies: 4
    Last Post: 01-25-2008, 04:38 AM
  5. Overiding an abstract method
    By eva in forum New To Java
    Replies: 5
    Last Post: 01-03-2008, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts