I want to create different files (ended with .txt but with different names(depends on what I put in the textfield "localDoNome") into a specific directory.
What I have now is:
String ficheiro = localDoNome.getText() + "_messageLo.txt"); PrintWriter writer = new PrintWriter(ficheiro); writer.close();
This code works fine for creating different files. Miss the part "to a specific directory".
I know that I can do something like:
PrintWriter writer = new PrintWriter("confdir/ficheiro.txt");
The problem with this last code is that is all String, this means the initial "ficheiro" would be all String too, which leads to not creating different files.