shh.util
Class SavePrintTools

Object
  extended bySavePrintTools

public class SavePrintTools
extends Object

Static methods for saving and printing.


Field Summary
static File LAST_DIR_USED
          The last directory used by a file chooser in this class; defaults to the user's current working directory.
 
Constructor Summary
SavePrintTools()
           
 
Method Summary
static void saveComponent(JComponent comptToSave, Component dialogParent, String suggestedFilename)
          Saves a JComponent's image to a file in a format like png or jpg.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_DIR_USED

public static File LAST_DIR_USED
The last directory used by a file chooser in this class; defaults to the user's current working directory.

Constructor Detail

SavePrintTools

public SavePrintTools()
Method Detail

saveComponent

public static void saveComponent(JComponent comptToSave,
                                 Component dialogParent,
                                 String suggestedFilename)
Saves a JComponent's image to a file in a format like png or jpg. The component should be showing on screen.

Parameters:
comptToSave - The JComponent to save.
dialogParent - The parent for the dialog boxes.
suggestedFilename - An initial default like myfile. The method will convert this to myfile.png, myfile.jpg, etc.