In Swing its quite prevalent to write down a category that implements ActionListener and include The present instance (ie 'this') being an ActionListener for parts. Prerequisite : Inheritance In Java, all non-static techniques are depending on the runtime type of the underlying item rather then the sort of the reference https://thisav36814.nizarblog.com/28982260/the-smart-trick-of-free-this-jav-that-no-one-is-discussing