This post is ancient history, but I'd like to log my belated thanks to Craig. I was also having problems cracking this one, but I cut and pasted Craig's code, ran it and finally annotated it until I knew what was going on.
Finally (it took about three hours
) the penny dropped... the listener is the PANEL in which the polygons are drawn, not the polygons themselves. Once the panel says it's clicked THEN you check to see if it's inside a polygon. :") It ALWAYS seems embarrassingly obvious once you understand...
Anyhow, just to let you know that your help is still bearing
fruit even 2 years later!
Simon*