APIdia Launch Partner
Top Description Constructors Methods
java.awt

public abstract Class PrintJob

extends Object
Class Inheritance
Known Direct Subclasses
sun.print.PrintJob2D

An abstract class which initiates and executes a print job. It provides access to a print graphics object which renders to an appropriate print device.
Author
Amy Fowler
See Also
Toolkit#getPrintJob

Constructor Summary

AccessConstructor and Description
protected
PrintJob()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public abstract void
end()

Ends the print job and does any necessary cleanup.

public void
finalize()

Overrides java.lang.Object.finalize.

Deprecated for removal since 9. Finalization has been deprecated for removal. See java.lang.Object#finalize for background information and details about migration options.

Ends this print job once it is no longer referenced.

public abstract Graphics

Returns:

the graphics context for printing the next page
getGraphics
()

Gets a Graphics object that will draw to the next page.

public abstract Dimension

Returns:

the page dimension
getPageDimension
()

Returns the dimensions of the page in pixels.

public abstract int

Returns:

the page resolution
getPageResolution
()

Returns the resolution of the page in pixels per inch.

public abstract boolean

Returns:

true if the last page will be printed first; otherwise false
lastPageFirst
()

Returns true if the last page will be printed first.

Inherited from java.lang.Object:
cloneequalsgetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrintJobback to summary
protected PrintJob()

Constructor for subclasses to call.

Method Detail

endback to summary
public abstract void end()

Ends the print job and does any necessary cleanup.

finalizeback to summary
public void finalize()

Overrides java.lang.Object.finalize.

Deprecated

for removal since 9.

Finalization has been deprecated for removal. See java.lang.Object#finalize for background information and details about migration options.

Ends this print job once it is no longer referenced.

Annotations
@Deprecated
since:9
forRemoval:true
@SuppressWarnings:removal
See Also
end
getGraphicsback to summary
public abstract Graphics getGraphics()

Gets a Graphics object that will draw to the next page. The page is sent to the printer when the graphics object is disposed. This graphics object will also implement the PrintGraphics interface. If PrintJob.end() has been called, this method will return null.

Returns:Graphics

the graphics context for printing the next page

See Also
PrintGraphics
getPageDimensionback to summary
public abstract Dimension getPageDimension()

Returns the dimensions of the page in pixels. The resolution of the page is chosen so that it is similar to the screen resolution.

Returns:Dimension

the page dimension

getPageResolutionback to summary
public abstract int getPageResolution()

Returns the resolution of the page in pixels per inch. Note that this doesn't have to correspond to the physical resolution of the printer.

Returns:int

the page resolution

lastPageFirstback to summary
public abstract boolean lastPageFirst()

Returns true if the last page will be printed first.

Returns:boolean

true if the last page will be printed first; otherwise false