/** * */ package io; // imports import java.io.*; /** * @author John H. Krantz * Allows saving of text output files * @version 0.1 */ public class SaveRowCol { /** Saves all the text in this TextPanel to a file. Set 'path' to "" to display a save as dialog. Returns 'false' if the user cancels the save as dialog.*/ public boolean saveAs(String path, String file) { // boolean isResults = false; if (path.equals("")) { // SaveDialog sd = new SaveDialog("Save as Text", title, ext); if (path == null) return false; } PrintWriter pw = null; try { FileOutputStream fos = new FileOutputStream(path); BufferedOutputStream bos = new BufferedOutputStream(fos); pw = new PrintWriter(bos); pw.println(file); } catch (IOException e) { //IJ.write("" + e); return true; } pw.close(); return true; } }