List of usage examples for javax.swing.text JTextComponent write
public void write(Writer out) throws IOException
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(); }