try
{
FileWriter write = new FileWriter("CropSystemDatabase.txt");
PrintWriter text = new PrintWriter(write);
text.println("TYPE OF CROPS = " + crop.getTypeCrop());
text.println("SEASONS = " + crop.getSeason());
text.println("NUMBER OF ACRES = " + crop.getNumberAcre());
text.println("CROPS CHOSEN = " + crop.getCropChosen());
text.println("TOTAL FERTILIZERS = " + crop.getTotalFertilizer());

{
text.print(" ");
text.print(" ");
text.print(" ");
}

text.flush();
write.close();
}
catch (IOException ie)
{
 System.out.println(ie);
}

how to modify it become no to overwrite current data? and save to another new line again when save new data... Help...

FileWriter write = new FileWriter("CropSystemDatabase.txt", true );

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.