3 Replies - 2855 Views - Last Post: 09 February 2010 - 07:59 PM Rate Topic: -----

#1 stephen0606  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 03-September 07

CLASS is not abstract and does not override abstract method.......HELP

Posted 09 February 2010 - 07:46 PM

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class StatusExample extends Applet implements ActionListener
{
     TextField statusField;
     Button statusButton;
 

     public void init() 
     {
          setLayout(new FlowLayout());
          statusButton = new Button("Set Status");
          statusField = new TextField("Type here");
          statusButton.addActionListener(this);
          statusField.addActionListener(this);
          add(statusButton);
          add(statusField);
     }

     public void ActionPerformed(ActionEvent act) 
     {
          if (act.getSource() == statusButton)
             getAppletContext().showStatus(statusField.getText() +"(WithButtonAction)");
          else
           getAppletContext().showStatus(statusField.getText() + " (With FieldAction)");
        }
   } 


I get this example from a website and i try use in netbean IDE but i notice an error states that "StatusExample is not abstract and does not override abstract method"...any idea?? there is no error in the source file name with the class name as well, maybe some silly syntax error again from me and i cant figure it out... :(

This post has been edited by stephen0606: 09 February 2010 - 07:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: CLASS is not abstract and does not override abstract method.......HELP

#2 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: CLASS is not abstract and does not override abstract method.......HELP

Posted 09 February 2010 - 07:55 PM

public void actionPerformed(ActionEvent act) {


Lowercase the 'a' in actionPerformed so it overrides the abstract method defined by ActionListener :)
Was This Post Helpful? 1
  • +
  • -

#3 stephen0606  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 03-September 07

Re: CLASS is not abstract and does not override abstract method.......HELP

Posted 09 February 2010 - 07:57 PM

View Posterik.price, on 09 February 2010 - 06:55 PM, said:

public void actionPerformed(ActionEvent act) {


Lowercase the 'a' in actionPerformed so it overrides the abstract method defined by ActionListener :)


OK,a silly mistake from me again, that make it works..thanks erik... :)

This post has been edited by stephen0606: 09 February 2010 - 07:59 PM

Was This Post Helpful? 0
  • +
  • -

#4 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: CLASS is not abstract and does not override abstract method.......HELP

Posted 09 February 2010 - 07:59 PM

No problem :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1