e686. 显示打印窗口

The print dialog allows the user to change the default printer settings such as the default printer, number of copies, range of pages, etc.

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

 

Related Examples
posted @ 2018-09-02 21:58  borter  阅读(137)  评论(0编辑  收藏  举报