im having a small problem with my properties files with a PrintWriter. This is the code for the main file:
package org.goverment;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Tg {
public static final void main(String[] args) throws Exception {
cout("The Goverment - Create your own country!/");
cout("Press the number associated with your choice then press enter./");
cout("1. New Game/");
cout("2. Continue/");
cout("3. ExitGame/");
int c = Integer.parseInt(cin());
if(c == 1) {
cout("/");
cout("Country name: ");
String name = cin();
cout("\nIs this a soviet country? (y/n): ");
String soviet = cin();
boolean svt;
if(soviet.equalsIgnoreCase("y") || soviet.equalsIgnoreCase("yes"))
svt = true;
else if(soviet.equalsIgnoreCase("n") || soviet.equalsIgnoreCase("no"))
svt = false;
else
svt = false;
Game.setup(Game.cc(), name, svt);
} else if(c == 2)
System.exit(0); // Game.c();
else if(c == 3)
System.exit(0);
}
private static String cin() throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
return br.readLine();
}
public static final void cout(String s) {
if(s.endsWith("/") || s.equalsIgnoreCase("")) {
System.out.println(s.substring(0, s.length() - 1));
} else {
System.out.print(s);
}
}
}
And this is the Game class: http://pastebin.com/bktg6nSc
This is the problem: The file isint created... i keep flushing and closing but nothing happens. i keep looking at the application data but no thegoverment.properties is there.
So what should i do? I really do need help, its for a school project and i must do it by 2 days.