Text File Output
<p>I need to output a .txt file onto the Desktop of the user, how do i do this in Java? is this code usable with some tweaking or does it require a start over from scratch?</p>

<pre><code>try {
    OutputStream fout = new FileOutputStream("test.txt");
    OutputStream bout = new BufferedOutputStream(fout);
    OutputStreamWriter out = new OutputStreamWriter(bout, "8859_1");

    out.write("test");

    out.flush();
    out.close(); 
} catch (UnsupportedEncodingException e) {
    System.out.println(
        "This VM does not support the Latin-1 character set."
    );
} catch (IOException e) {
    System.out.println(e.getMessage());
}
</code></pre>
