Looks like it´s implementing an interface ? Can somebody provide me an explanation or a link to some book that explains that ?
Thanks in advance.
posted 8 years ago
It's creating a Listener instance and using an in-line declaration to override the "handleEvent" method, that's what seems to contain the logic for the toggle button -> radio button behavioural change mentions in the comment header.
That's an anonymous inner class example. That's probably the only place you will apply "new" keyword to the name of an interface. That's how you create an object of a class which implements an interface. The class implementing the interface becomes anonymous here as you have a reference of type interface to an object of that class. Nested classes from SUN tutorials gives you a brief explanation.