Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Action.Listener exception.

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Thanked 0 Times in 0 Posts

    Default Action.Listener exception.

    The code is in this pastebin: [Java] import javax.swing.*; import java.awt.*; import java.awt.event.*; public cl - Pastebin.com

    Basically, the problem is that i've got this error:

    "The type swing2.Action must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent)"

    From the linked code. It's pretty annoying if i'm honest and i've been looking around for solutions. The error appears on line 23.
    Can you guys help me out please?

  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Tavistock, UK
    Thanked 103 Times in 93 Posts

    Default Re: Action.Listener exception.

    That sounds like quite an easy problem to fix, but you'll be more likely to get a response if you post your code here between code, /code tags or highlight=java, /highlight tags - put them in square brackets and you're good to go. I'd do it myself, but I don't know how to post a square bracket on this forum!

    On second thoughts, I've had a quick look and you've got the wrong case in your method name. I'd be surprised if your Anglo Saxon frame title wouldn't trigger some sort of moderation on this forum. I'm quite fond of the least acceptable expletive in our quaint cant myself, but I'm not sure a request-for-bugfix is quite the place for it. Still, I guess you didn't come here for a lesson in etiquette.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,445 Times in 2,396 Posts

    Default Re: Action.Listener exception.

    Does the class in question define the method referred to in the error message?
    If the class extends an abstract class it must define the abstract methods. If you think you have defined the method, add an @Override statement just before the method definition to have the compiler check it for you.

    When asking questions about code, please post the code in the forum.
    And also the FULL text of the error message.

Similar Threads

  1. Action Listener Error
    By dookie1293 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: June 22nd, 2011, 09:34 PM
  2. Action Listener
    By Suzanne in forum What's Wrong With My Code?
    Replies: 7
    Last Post: May 29th, 2010, 10:50 AM
  3. Beginner Help (Action Listener)
    By gradstudent in forum AWT / Java Swing
    Replies: 2
    Last Post: April 30th, 2010, 10:26 AM
  4. Action Listener
    By kray66 in forum AWT / Java Swing
    Replies: 2
    Last Post: April 19th, 2010, 03:26 PM
  5. Need Help Action Listener....
    By vhizent23 in forum AWT / Java Swing
    Replies: 2
    Last Post: October 9th, 2009, 01:46 PM