File f = new File("c:\\test\\test.txt");PrintWriter t = new PrintWriter (new FileWriter(f));That is using the Java 1.1 io library. Just changr test.txt toc:\\test\\text.txt