1 Replies - 18876 Views - Last Post: 23 April 2009 - 04:00 PM Rate Topic: -----

#1 cookie_272  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 05-April 09

Class is not abstract and does not override abstract method actionPerf

Posted 23 April 2009 - 03:09 PM

 import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.*;
import javax.swing.border.*;
import java.util.*;

public class ShowProgressBar extends JFrame implements ActionListener 
{
	private JProgressBar jpb = new JProgressBar();
	
	private JButton Cancel = new JButton("Cancel");
	
		public ShowProgressBar() 
		{
			setLayout (new FlowLayout(FlowLayout.CENTER));
			
			JPanel jPanel1 = new JPanel();
			jPanel1.add(Cancel);
			
			this.add(jpb, BorderLayout.NORTH);
			pack();
			ShowProgressBar showProgressBar = new ShowProgressBar();
			showProgressBar.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			showProgressBar.setTitle("Current Progress...");
			showProgressBar.setSize(100, 20);
			showProgressBar.setVisible(true);
		}
		
}


Error:
ShowProgressBar is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener

Im getting this error, but I have other classes set up in the same way and I don't get an error, so I'm completely baffeled!

Any one know why?

Thanks,

Cookie_272

Is This A Good Question/Topic? 0
  • +

Replies To: Class is not abstract and does not override abstract method actionPerf

#2 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1953
  • View blog
  • Posts: 4,053
  • Joined: 11-December 07

Re: Class is not abstract and does not override abstract method actionPerf

Posted 23 April 2009 - 04:00 PM

You have implements ActionListener but didn't provide the required actionPerformed() method. If you don't need that method get rid of the "implements" part.

This post has been edited by cfoley: 23 April 2009 - 04:01 PM

Was This Post Helpful? 1

Page 1 of 1