I have a class lets say myFrame that extends JFrame. On this frame I have a button with a action listener event. When this event triggers I want to make changes to the class(myFrame) like I would have done in the constructor of the class using this.add() or whatever function I need.
The problem is that if I use "this" in this action listener I am no longer referring to the current instance of the class myFrame. I vaguely remember that I have come across this issue before but I cannot remember how I went around it. I think I might have assigned this to some variable in the constructor of the class.