The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.awt.print  [6 examples]

e685. Displaying the Page Format Dialog

The page format dialog allows the user to change the default page format values such as the orientation and paper size.
    PrinterJob pjob = PrinterJob.getPrinterJob();
    
    // Get and change default page format settings if necessary.
    PageFormat pf = pjob.defaultPage();
    pf.setOrientation(PageFormat.LANDSCAPE);
    
    // Show page format dialog with page format settings.
    pf = pjob.pageDialog(pf);

 Related Examples
e681. The Quintessential Printing Program
e682. Getting the Dimensions of a Printed Page
e683. Setting the Orientation of a Printed Page
e684. Printing Pages with Different Formats
e686. Displaying the Print Dialog


© 2002 Addison-Wesley.