Example usage for javax.swing.text.html HTMLWriter HTMLWriter

List of usage examples for javax.swing.text.html HTMLWriter HTMLWriter

Introduction

In this page you can find the example usage for javax.swing.text.html HTMLWriter HTMLWriter.

Prototype

public HTMLWriter(Writer w, HTMLDocument doc) 

Source Link

Document

Creates a new HTMLWriter.

Usage

From source file:plugin.notes.gui.NotesTreeNode.java

/** Saves this node's data. */
public void save() {
    if (dirty) {// w w  w .j  ava  2  s  .  c o  m
        try {
            File notes = new File(dir.getAbsolutePath() + File.separator + DATA_HTML);

            if (!notes.exists()) {
                notes.createNewFile();
            }

            if (pane != null) {
                FileWriter fw = new FileWriter(notes);
                HTMLWriter hw = new HTMLWriter(fw, notesDoc);
                hw.write();
                fw.flush();
                fw.close();
                dirty = false;
            }
        } catch (Exception e) {
            Logging.errorPrint(e.getMessage(), e);
        }
    }
}