View RSS Feed

Java AWT

Java Abstract Window Toolkit (AWT)

  1. Basic Printing Program

    by , 03-07-2012 at 06:07 PM
    Printing consists of following two parts:

    Job Control: Following are part of job control.
    • Creating a print job
    • Associate it with printer
    • Specify no of copies
    • User print dialog interaction

    Page Imaging: It includes drawing content to a page.
    The java.awt.print package includes the classes to create a printer job and most other related classes are part of this package.
    Java Code:
    import java.awt.print.*;
    PrinterJob job = PrinterJob.getPrinterJob();