You can use the APPDATA environment variable which is usually "C:\Users\username\AppData\Roaming"
And you can get it using System.getenv() function :
String appData = System.getenv().get("APPDATA");
EDIT :
Look at this example (create a directory "myGame" and create a file "myGameFile" into this directory).
The code is awful but it's just to give you an idea of how it works.
String gameFolderPath, gameFilePath;
gameFolderPath = System.getenv().get("APPDATA") + "\\myGame";
gameFilePath = gameFolderPath + "\\myGameFile";
File gameFolder = new File(gameFolderPath);
if (!gameFolder.exists()) {
// Folder doesn't exist. Create it
if (gameFolder.mkdir()) {
// Folder created
File gameFile = new File(gameFilePath);
if (!gameFile.exists()) {
// File doesn't exists, create it
try {
if (gameFile.createNewFile()) {
// mGameFile created in %APPDATA%\myGame !
}
else {
// Error
}
} catch (IOException ex) {
// Handle exceptions here
}
}
else {
// File exists
}
}
else {
// Error
}
}
else {
// Folder exists
}