I was wondering how to get java to save a text file named hello.txt
to the desktop without writing
"C:\Users\Austin\Desktop"
Any help would be great. so like:
FileWriter fileWriter = new FileWriter(fileName.getText(), true);
..and the fileName.getText()
is just going to be the 'hello'.
UPDATE:
i think that i would be able to use the jfilechooser, so would this work?
JFileChooser chooser = new JFileChooser();
chooser.setVisible(true);
would that work? and if so, how would i get it to save the file using the selection in there?
im a noob.... :(
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…