Hi Ada,
You can use following code segment to rename a file:
// File (or directory) with old name
File file = new File("oldname");
// File (or directory) with new name
File file2 = new File("newname");
// Rename file (or directory)
boolean success = file.renameTo(file2);
if (!success) {
// File was not successfully renamed
}
File class has several similar useful methods. I reccomend you to check them:
File (Java 2 Platform SE v1.4.2)