net.simplace.core.service.PrintHelper
This helper class provides methods used for printing stuff on a printing device.
public class PrintHelper implements java.lang.Runnable, java.awt.print.Printable {
// Constants
public static final int TYPE_PDF;
public static final int TYPE_RTF;
public static final int TYPE_HTML;
// Class Methods public static void
print(Component aComponent,
FWObservable aObservable)
throws PrinterException;
Prints a GUI component on a printer. Before printing is started, a cross-platform dialog
appears to the user who can select the desired printer and customise the print properties. If
the print dialog is canceled, no print job will start.
- aComponent
a GUI component to be printed
- aObservable
public static void
print(Component aComponent) throws PrinterException;
Prints a GUI component on a printer. Before printing is started, a cross-platform dialog
appears to the user who can select the desired printer and customise the print properties. If
the print dialog is canceled, no print job will start.
- aComponent
a GUI component to be printed
// Public Instance Methods public void run(); // From java.lang.Runnable
Handles the whole printing process.
Note: it's implemented in a new thread because
looking up the printing device takes a lot of time
public int print(Graphics g, PageFormat pf, int pageIndex);
// From java.awt.print.Printable
}