Why isnt ActionListener working?

Slurba

Why isn't this ActionListener working? I've tried to follow tutorials but I keep getting the same error.

public class listenerTest implements ActionListener {
@Override //<-- This adds another error
public void actionPerformed(ActionEvent e) 
{
    System.out.println("Message"+e.toString());
    System.exit(0);
}
}

And in the other file:

loginButton.addActionListener(new listenerTest());

NetBeans says

there are compilation errors on listenerTest class "listenerTest is not abstract and 
does not override abstract method actionPerformed(ActionEvent) in ActionListener"` 

and the error on @Override says method does not override or implement a method from supertype.

Any help how to fix this?

Slurba

I had mixed up JavaFX and AWT ActionEvent imports. Thanks, @Reimeus!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why this regex isnt working?

From Dev

why isnt this padding working?

From Dev

Why this code isnt working?

From Dev

Why .hasClass function isnt working?

From Dev

Why isnt Gesture Listener working?

From Dev

Why isnt this simple inheritance working?

From Dev

Why isnt my middleware working?

From Dev

Why my code isnt working?

From Dev

Why isnt my Background color working in a ComboBox

From Dev

Why isnt my foreach loop working?

From Dev

Why isnt the move method working in Java?

From Dev

install google-chrome isnt working, why?

From Dev

Why isnt my update from client working?

From Dev

Why isnt collapse from bootstrap working?

From Dev

Why isnt my Background color working in a ComboBox

From Dev

Why isnt this working? ZXing, Bitmap, ImageSource

From Dev

I can't figure out why my clearfix isnt working

From Dev

Why isnt df["ColumA"] = df_2["ColumnB"] working as expected?

From Dev

Is there a reason why my clearInterval function isnt working in React?

From Dev

I can't figure out why my clearfix isnt working

From Dev

Why isnt my nested ng-repeat working

From Dev

Why isnt this merge sort on linked list working properly?

From Dev

not sure why my looping function isnt working here

From Dev

Why isnt Bootstrap Grid working properly after my main header?

From Dev

Would like to understand why this "setInterval" in my code isnt working?

From Dev

JQuery insertBefore() isnt working

From Dev

addClass() isnt working

From Dev

HTML Mandarin isnt working

From Dev

Autoboxing isnt working properly