I'm desesperatly trying to do return to the line in a text file. But everything is wrote in one line
Here's my code :
addName="saved\\" +name_t.getText() + ".txt";
System.out.println(addName);
File f = new File(addName);
try {
f.createNewFile();
FileWriter fw = new FileWriter(f);
fw.write(pan.getValues());
fw.close();
}
catch (IOException e1) {
e1.printStackTrace();
}
And my getValues function :
public String getValues()
{
values = "";
for(int a=0; a<randL.size();a++)
{
values = values + "Temperature at " + dateL.get(a) + " is : " + (Double.toString(randL.get(a)) + "°C\n");
}
return values;
}
The '\n' doesn't seem to work
Any thoughts ?