Example usage for javax.swing.text JTextComponent write

List of usage examples for javax.swing.text JTextComponent write

Introduction

In this page you can find the example usage for javax.swing.text JTextComponent write.

Prototype

public void write(Writer out) throws IOException 

Source Link

Document

Stores the contents of the model into the given stream.

Usage

From source file:LoadSave.java

public static void doSaveCommand(JTextComponent textComponent, String filename) throws Exception {
    FileWriter writer = null;//  www.  j a  va 2  s .com
    writer = new FileWriter(filename);
    textComponent.write(writer);
    writer.close();
}