FileDocCategorySizeDatePackage
UnbelievablySimplePrint.javaAPI DocExample798Mon May 01 14:42:02 BST 2000None

UnbelievablySimplePrint

public class UnbelievablySimplePrint extends Object implements Printable

Fields Summary
private static Font
sFont
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    PrinterJob job = PrinterJob.getPrinterJob(  );
    job.setPrintable(new UnbelievablySimplePrint(  ));
    if (job.printDialog(  )) {
      try {
        job.print(  );
      }
      catch (PrinterException e) {}
    }
    System.exit(0);
  
public intprint(java.awt.Graphics g, java.awt.print.PageFormat Pf, int pageIndex)


         
        
    if (pageIndex > 0) return NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D)g;
    g2.setFont(sFont);
    g2.setPaint(Color.black);
    g2.drawString("Save a tree!", 96, 144);
    return PAGE_EXISTS;