Trail: 2D Graphics
Lesson: Printing
Printing
This lesson teaches you how to use the Java Printing API to print from your Java applications. You'll learn how to render the contents of your components to a printer instead of a display device and how to compose and print multipage documents. This lesson assumes that you've read the first lesson in this trail, Overview of the Java 2D API, and that you are familiar with using a Graphics2D rendering context.

Overview of Printing in Java

This section gives you an overview of the support for printing AWT and Java 2D graphics and describes the Java printing model.

Printing the Contents of a Component

This section teaches you how to create a PrinterJob and how to use a Printable to print the contents of a component.

Displaying a Page Setup Dialog

This section describes the standard page setup dialog and teaches you how to use it to allow a user to set up a print job.

Printing a Collection of Pages

This section teaches you how to set up a Book to print a collection of pages that do not all have the same size or orientation.
Before you ship any programs with printing code, be sure to read Improving Printing Performance.
Previous page: Previous Lesson
Next page: Overview of Printing in Java