API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt.print. PrinterJob View Source
Author(s)
Since
Version
Serial
Hierarchy
 Object
      PrinterJob
Implements
Subclasses
Description
publicabstract abstract class PrinterJob
  The PrinterJob class is the principal class that controls printing.
See also:   
Constructors
public PrinterJob ()
A PrinterJob object should be created using the static getPrinterJob method.
Methods
Hide/Show inherited methods
publicabstract void cancel ()
  Cancels a print job that is in progress.
public PageFormat defaultPage ()
  Creates a new PageFormat instance and sets it to a default size and orientation.
publicabstract PageFormat defaultPage (PageFormat page)
  Clones the PageFormat argument and alters the clone to describe a default page size and orientation.
publicabstract int getCopies ()
  Gets the number of copies to be printed.
publicabstract String getJobName ()
  Gets the name of the document to be printed.
public PageFormat getPageFormat (PrintRequestAttributeSet attributes)
  Calculates a PageFormat with values consistent with those supported by the current PrintService for this job (ie the value returned by getPrintService()) and media, printable area and orientation contained in attributes.
publicstatic PrinterJob getPrinterJob ()
  Creates and returns a PrinterJob which is initially associated with the default printer.
public PrintService getPrintService ()
  Returns the service (printer) for this printer job.
publicabstract String getUserName ()
  Gets the name of the printing user.
publicabstract boolean isCancelled ()
  Returns true if a print job is in progress, but is going to be cancelled at the next opportunity; otherwise returns false.
publicstatic PrintService lookupPrintServices ()
  A convenience method which looks up 2D print services.
publicstatic StreamPrintServiceFactory lookupStreamPrintServices (String mimeType)
  A convenience method which locates factories for stream print services which can image 2D graphics.
publicabstract PageFormat pageDialog (PageFormat page) throws HeadlessException
  Displays a dialog that allows modification of a PageFormat instance.
public PageFormat pageDialog (PrintRequestAttributeSet attributes) throws HeadlessException
  A convenience method which displays a cross-platform page setup dialog.
publicabstract void print () throws PrinterException
  Prints a set of pages.
public void print (PrintRequestAttributeSet attributes) throws PrinterException
  Prints a set of pages using the settings in the attribute set.
publicabstract boolean printDialog () throws HeadlessException
  Presents a dialog to the user for changing the properties of the print job.
public boolean printDialog (PrintRequestAttributeSet attributes) throws HeadlessException
  A convenience method which displays a cross-platform print dialog for all services which are capable of printing 2D graphics using the Pageable interface.
publicabstract void setCopies (int copies)
  Sets the number of copies to be printed.
publicabstract void setJobName (String jobName)
  Sets the name of the document to be printed.
publicabstract void setPageable (Pageable document) throws NullPointerException
  Queries document for the number of pages and the PageFormat and Printable for each page held in the Pageable instance, document.
publicabstract void setPrintable (Printable painter)
  Calls painter to render the pages.
publicabstract void setPrintable (Printable painter, PageFormat format)
  Calls painter to render the pages in the specified format.
public void setPrintService (PrintService service) throws PrinterException
  Associate this PrinterJob with a new PrintService.
publicabstract PageFormat validatePage (PageFormat page)
  Returns the clone of page with its settings adjusted to be compatible with the current printer of this PrinterJob.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar