A while back, I was extending ActionListener but for reasons I can't fathom it stopped compiling right. I looked around and found the following method.
I don't know what this technique or concept is called, but I want to learn more about it, instead of just copy, pasting, and modifying it without understanding the mechanics behind it. Anyone know what I'm talking about?
Anonymous class is class which doesn't have name. This is useful when you want some functionality is specific to some classes such as in given example the Listener method which you are implementing is not shared by another class it is totally or more specific it is made for only to the that specified object that time anonymous class is useful.
More generally, this technique is called a "callback", since it defines a method that is called back by the application at some later point in time. In Java, anonymous inner classes are used to implement it, but the technique itself is much older than that, going back at least to X-Windows.