I have no idea what you're asking. What are you trying to prevent from "leaving the applet"? What exactly does that even mean?

By the way, this is the completely wrong forum for this question....