java.awt.print package and
provides for creating a PrinterJob, displaying a printer dialog to
the user, and printing paginated graphics using the same
java.awt.Graphics and java.awt.Graphics2D classes that are used to
draw to the screen.
Many of the features in the Java Print Service, such as printer discovery and specification of printing attributes, are also very important to users of the Java 2D printing API. To make these features available to users of Java 2D printing, the java.awt.print package allows access to the Java Print Service from the Java 2D printing API.
Developers of Java 2D printing applications have four ways of using the Java Print Service with the Java 2D API:
PrinterJob.PrinterJobDocPrintJob and a service-formatted DocFlavorDocPrintJob and a service-formatted DocFlavor