Toiling with HTMLEditorKit
<p>Im a novice Java programmer trying to use the HTMLEditorKit library to travers a HTML document and alter it to my linking (mostly for the fun of it, what im doing could be done in hand without a problem)</p>

<p>But my problem is: After i have modifed my HTML file i am left with a HTMLDocument that i have no clue how to save back to a HTML file.</p>

<pre><code>        HTMLEditorKit kit = new HTMLEditorKit();
        File file = new File("local file")
        HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument(); 
        doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
        InputStreamReader(url.openConnection().getInputStream()); 
        FileReader HTMLReader = new FileReader(file); 
        kit.read(HTMLReader, doc, 0); 
</code></pre>

<p>after that i do my thing with the "doc" element.</p>

<p>Now that im done with that i just want to save it back, preferablly overwriting the file which i got HTML from in the first place.</p>

<p>Anyone able to tell me how to save the modified HTMLdocument into a html file afterwards?</p>

<p>Regards Rasmus</p>
