rename a file

i'm trying to rename file but it keeps failing , what am i doing wrong it looks ok to me?

File myfile = new File("C:\\afile.txt");

boolean renamed = myfile.renameTo(new File("C:\\"+"newfilename.txt"));

if(renamed==true)

System.out.println("file successfully renamed");

else

System.out.println("file was NOT renamed");

[364 byte] By [louie171] at [2007-9-30 19:39:34]
# 1
Does the new file already exist?Do you have write access to the directory?
paulcw at 2007-7-7 0:24:21 > top of Java-index,Security,Event Handling...
# 2
it's not the code... the code works fine.
elubin at 2007-7-7 0:24:21 > top of Java-index,Security,Event Handling...