I need code on btou Button to save text in jtextfiled on Desktop
public void savetext(String filename) { try { String msg = jtextfiled.getText(); fr = new FileWriter(filename); fr.write(msg); fr.flush(); fr.close(); } catch (Exception e) { e.printStackTrace(); } }
here is the function that you write out a text file. where "filename" is the path to the text file that you need to save to. hopefully be useful to you.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
public void savetext(String filename)
{
try
{
String msg = jtextfiled.getText();
fr = new FileWriter(filename);
fr.write(msg);
fr.flush();
fr.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
here is the function that you write out a text file. where "filename" is the path to the text file that you need to save to. hopefully be useful to you.