Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.print

Class PrinterJob

java.lang.Object
|
+--java.awt.print.PrinterJob


public abstract class PrinterJob

extends Object

This class controls printing.

Author:

Constructor Summary

PrinterJob()

Initializes a new instance of PrinterJob.

Method Summary

voidcancel()

Cancels an in progress print job.
java.awt.print.PageFormatdefaultPage()

Returns an instance of the default page which will have the default paper and orientation.
java.awt.print.PageFormatdefaultPage(java.awt.print.PageFormat page_format)

Clones the specified PageFormat object then alters the clone so that it represents the default page format.
intgetCopies()

Returns the number of copies to be printed.
java.lang.StringgetJobName()

Returns the name of the print job.
static java.awt.print.PrinterJobgetPrinterJob()

Creates a new print job.
java.lang.StringgetUserName()

Returns the printing user name.
booleanisCancelled()

Tests whether or not this job has been cancelled.
java.awt.print.PageFormatpageDialog(java.awt.print.PageFormat page_format)

Displays a dialog box to the user which allows the page format attributes to be modified.
voidprint()

Prints the pages.
booleanprintDialog()

Displays a dialog box to the user which allows the print job attributes to be modified.
voidsetCopies()

Sets the number of copies to be printed.
java.lang.StringsetJobName(java.lang.String job_name)

Sets the name of the print job.
voidsetPageable(java.awt.print.Pageable pageable)

This sets the pages that are to be printed.
voidsetPrintable(java.awt.print.Printable printable)

Sets this specified Printable as the one to use for rendering the pages on the print device.
voidsetPrintable(java.awt.print.Printable printable, java.awt.print.PageFormat page_format)

Sets the Printable and the page format for the pages to be printed.
java.awt.print.PageFormatvalidatePage(java.awt.print.PageFormat page)

Makes any alterations to the specified PageFormat necessary to make it work with the current printer.

Constructor Details

PrinterJob

public PrinterJob()

Initializes a new instance of PrinterJob.


Method Details

cancel

public void cancel()

Cancels an in progress print job.


defaultPage

public PageFormat defaultPage()

Returns an instance of the default page which will have the default paper and orientation.

Returns:


defaultPage

public PageFormat defaultPage(java.awt.print.PageFormat page_format)

Clones the specified PageFormat object then alters the clone so that it represents the default page format.

Parameters:

Returns:


getCopies

public int getCopies()

Returns the number of copies to be printed.

Returns:


getJobName

public String getJobName()

Returns the name of the print job.

Returns:


getPrinterJob

public static PrinterJob getPrinterJob()

Creates a new print job.

Returns:


getUserName

public String getUserName()

Returns the printing user name.

Returns:


isCancelled

public boolean isCancelled()

Tests whether or not this job has been cancelled.


pageDialog

public PageFormat pageDialog(java.awt.print.PageFormat page_format)

Displays a dialog box to the user which allows the page format attributes to be modified.

Parameters:

Returns:


print

public void print()

Prints the pages.


printDialog

public boolean printDialog()

Displays a dialog box to the user which allows the print job attributes to be modified.

Returns:


setCopies

public void setCopies()

Sets the number of copies to be printed.


setJobName

public String setJobName(java.lang.String job_name)

Sets the name of the print job.

Parameters:


setPageable

public void setPageable(java.awt.print.Pageable pageable)

This sets the pages that are to be printed.

Parameters:


setPrintable

public void setPrintable(java.awt.print.Printable printable)

Sets this specified Printable as the one to use for rendering the pages on the print device.

Parameters:


setPrintable

public void setPrintable(java.awt.print.Printable printable, java.awt.print.PageFormat page_format)

Sets the Printable and the page format for the pages to be printed.

Parameters:


validatePage

public PageFormat validatePage(java.awt.print.PageFormat page)

Makes any alterations to the specified PageFormat necessary to make it work with the current printer. The alterations are made to a clone of the input object, which is then returned.

Parameters:

Returns: