This Java tip explains a method of displaying a page format dialog. This may help developer to give an option to the user to change the default page format values such as the orientation and paper size.

   PrinterJob printtask = PrinterJob.getPrinterJob();
    // Change default page format settings if necessary.
    PageFormat format = printtask.defaultPage();
    // Display page format dialog with page format settings.
    format = printtask.pageDialog(pf);