Displaying the Page Format Dialog: changes the default page format such as orientation and paper size. : Print « 2D Graphics GUI « Java
- Java
- 2D Graphics GUI
- Print
Displaying the Page Format Dialog: changes the default page format such as orientation and paper size.
import java.awt.print.PageFormat;
import java.awt.print.PrinterJob;
public class Main {
public static void main(String[] argv) throws Exception {
PrinterJob pjob = PrinterJob.getPrinterJob();
PageFormat pf = pjob.defaultPage();
pf.setOrientation(PageFormat.LANDSCAPE);
pf = pjob.pageDialog(pf);
}
}
Related examples in the same category