Showing a Print Dialog


Showing a print dialog is a common task for every print job. This example shows how to do it:

PrinterJob pjob = PrinterJob.getPrinterJob();
PageFormat pf = pjob.defaultPage();
pjob.setPrintable(new PrintableClass(), pf);
try {
    if (pjob.printDialog()) {
} catch (PrinterException e) {


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.