Well, I am using a code that creates a file. Right now it creates the file on the place where the game is. However I would like the fie to be written in the documents. Also I would like to know how to create folders through the game.
So here is the code I am using right now:
How do I make it write the file in the documents and how do I create files?
I need to know this since my game has a "creator" mode where the player is able to create his own level.
BufferedWriter file = null;
try {
file = new BufferedWriter(new FileWriter("MustRead.txt"));
file.write("Warning! A virus has been detected!");
file.close();
}
catch (IOException ioe) {
ioe.printStackTrace();
}
finally {
try {
file.close();
}
catch (IOException ioe) {
ioe.printStackTrace();
}