To create a File into the same folder in your project, your path has to be relative.
The path that you are giving is absolute, because it is starting from /
. For your path to be relative, remove /
from the path and try this :
File file = new File("textfile.txt");