Mike Simmons wrote:
Siegfried Heintze wrote:I don't understand how that "as ActionListener" works when we only give it one function.
Well, ActionListener only has one method, so I guess Groovy translates the one code block into an ActionListener implementation that uses the code block as the implementation of the one method. If ActionListener had more than one method, this probably wouldn't work.
I'm not really a Groovy programmer though, so maybe it would be better to ask these questions in the CodeRanch Groovy forum. Or perhaps some nice moderator-type will move the thread over there for you.