I'd like to know how I can get the directory where the scenario (or .jar file) itself is saved on my computer so I can save files there. An no, it doesn't have to run on the greenfoot site or the browser.
java.io.File file = new java.io.File("filename.txt"); // referenced as in 'jar' file
if (!file.exists()) file = new java.io.File("../filename.txt"); // referenced as in greenfoot applicationimport java.io.File;
File file = new File("filename.txt");
if (!file.exists()) file = new File("../filename.txt");