Maybe all those errors are caused by failure to indent the code consistently, so you can't readily see which class you are in.
Piet Souris wrote:There are more serious errors. . . . . You have an inner class . . . You do have a method 'actionPerformed', but that is unrelated to this class. . . . a constructor of your class 'Swing' that is part of your outerclass . . .
class XYZ is not abstract and doesn't override method pqr.
But OP is using the @Override annotation, which should highlight that error. In view of the other errors you mentioned, I wonder whether we are seeing exactly the same code; even the tiniest differences if the code is not copied with ctrl‑C—ctrl‑V can cause us to get completely different compiler errors.
Piet Souris wrote:. . . the method to override is called 'actionPerformed', with a capital P. . . .
I got suspicious because I was getting different error messages.
Piet Souris wrote:. . . . I got several errors, the most important one being that you cannot access an instance variable from a static method . . .