java IO question
<p>im trying to get my "submit" button to save the gui in a text file, ive made the gui and the button listener etc but im having trouble making the method that saves the information from the gui into a text file.</p>

<p>so far i have</p>

<pre><code>public void save(){
File k1 = new File("documents/"+"newfile.txt");
try {
 k1.createNewFile();
 FileWriter kwriter = new FileWriter(k1);
 BufferedWriter bwriter = new BufferedWriter(kwriter);

 bwriter.write(txtField1.getText().trim());
 bwriter.newLine();

 bwriter.close();

} catch (IOException e) {

 e.printStackTrace();
}
}
</code></pre>

<p>but it doesnt seem to work, nothing happens. is there anything im missing?</p>
