Results 1 to 4 of 4
  1. #1
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Unhappy ...is not abstract and does not override abstract method...

    Hi!
    I get the error mentioned in the topic, and I have googled it and all I could find was that it was caused by a missnaming in the implement thingy!

    But Im realy not! I'v quadrible checked the java book im reading, it's not miss spelled, but still I get this error!
    Please help me!

    Error message:
    Java Code:
    Interface is not abstract and does not override abstract method actionPreformed
    Heres my code:
    PHP Code:
    import javax.swing.*;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    
    class Interface extends JFrame implements ActionListener {
    	JLabel status = new JLabel();
    	JTextField textField = new JTextField(30);
    	JComboBox convertOpt = new JComboBox();
    	JButton go = new JButton();
    	
        public Interface() {
        	setLayout(new FlowLayout());
        	add(status);
        	add(textField);
        	convertOpt.addItem("Crypt");
        	convertOpt.addItem("Decrypt");
        	add(convertOpt);
        	add(go);
        	go.addActionListener(this);
        	pack();
        	setVisible(true);
        }
        
        public void actionPreformed(ActionEvent e){
        }
        
        
    }
    Last edited by Addez; 09-16-2009 at 08:56 PM. Reason: Forgot to add the full error message

  2. #2
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    6

    Default

    interfaces cannot implement methods. you should review what an interface and implementing classes are. also, i believe an interface can only extend an interface, not a class.

  3. #3
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    Ok so I renamed the class to GameFrame but it does no diffrence!
    It gives same error tho it changed the name "Interface" to "GameFrame"..

  4. #4
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    nvm, apparently performed is spelled performed, not preformed as I tought..
    Lolz, sorry for my bad english XD

Similar Threads

  1. Replies: 2
    Last Post: 03-26-2010, 05:12 PM
  2. Replies: 6
    Last Post: 02-11-2009, 10:51 AM
  3. Replies: 2
    Last Post: 11-21-2008, 12:20 AM
  4. Replies: 6
    Last Post: 10-27-2008, 12:25 AM
  5. Overiding an abstract method
    By eva in forum New To Java
    Replies: 5
    Last Post: 01-03-2008, 04: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
  •