This content has been marked as final. Show 1 reply
Actually, when it comes to something not too advanced, trying to use a text file probably doesn't qualify. The thing is, Java applets are executed in a sandbox inside the browser, and typically not allowed to wander around outside of it. Which means that, unless you specifically assign permissions otherwise (which qualifies as "advanced"), your applet probably doesn't have access to the user's file system.
Much simpler would be to use a field. Now, I hate public fields, so I'd use a private field and a public accessor. A field like theAnswer, with an accessor like setTheAnswer, that your popup window calls just before it closes. That way, you don't have to step outside of the sandbox.