You either need to implement the method specified in ActionLister or remove it like ksivananth said. Looking at the code, I think initially you wanted to use this class as an action listener:
//quarterButton.addActionListener(

You either need to implement the method specified in ActionLister or remove it like ksivananth said. Looking at the code, I think initially you wanted to use this class as an action listener:
//quarterButton.addActionListener( this );
quarterButton.addActionListener( new ActionListener( )
{
public void actionPerformed( ActionEvent e )
{
//numberOfQuarters++;
setBackground( Color.GREEN );
}
} );

But that line is commented out so it's safe to remove the "implements ActionListener" part, just as suggested above.

Or else if you don't want the anonymous inner class, then you can add an actionPerformed () method with the same code, to your ParkingMeterGUI2 class and un-comment the statement: >> //quarterButton.addActionListener( this );
(remove the current anonymous action listener too, in that case)

0

Featured Post

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

For customizing the look of your lightweight component and making it look lucid like it was made of glass.
Or: how to make your component more Apple-ish ;)
This tip assumes your component to be of rectangular shape and completely opaque.
(COD…

Introduction
This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…

Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop.
Define While Loop:
Basic Example:
Explanatio…