Hi. Im writing an rpg in java. Ive managed to load a savegame and its data based on URL's. I can also create maps and walk around, etc. However, I cannot save my data. I tried opening a URLConnection but nothing appears when i write to it. Any help?
Applet's can only access URL's constructed from their codebase (i.e. the URL they were loaded from).
The methods "getCodeBase()" and also IIRC "getCodeBaseDirectory()" (or something like that) should be used when constructing the URL you want to connect to. Youi need to proivide one of these as part of the arguments to the URL constructor. This is all explained in the docs.
Note: if you alter the security policy, this requirement vanishes; but that requires EVERY user of your app to manually alter their own security policies. There are other ways of achieving the same effect, and all relly on getting the user to in some way mark your applet as "trusted".