updated how dispose method is registerd to parent applet, in conformance
with processing 2