Package java.awt.print

Examples of java.awt.print.PrinterJob.printDialog()


//    }

    printerJob.setJobName(jobName);
    printerJob.setPageable(document);
    printerJob.setCopies(getNumberOfCopies(reportConfiguration));
    if (printerJob.printDialog())
    {
      printerJob.print();
      return true;
    }
    return false;
View Full Code Here


    /** Prints the document */
    public void startPrinterJob(boolean showDialog) {
        PrinterJob pj = PrinterJob.getPrinterJob();
        pj.setPageable(renderer);
        if (!showDialog || pj.printDialog()) {
            try {
                pj.print();
            } catch (PrinterException e) {
                e.printStackTrace();
            }
View Full Code Here

        //
        // If required, pop up a dialog to select the printer
        //
        Boolean showPrinterDialog = (Boolean)hints.get(KEY_SHOW_PRINTER_DIALOG);
        if(showPrinterDialog != null && showPrinterDialog.booleanValue()){
            if(!printerJob.printDialog()){
                // Dialog was cancelled, meaning that the print process
                // should be stopped.
                return;
            }
        }
View Full Code Here

            pjob.setJobName(file.getName());
            Book book = new Book();
            book.append(pages, pf, pdfFile.getNumPages());
            pjob.setPageable(book);

            if (pjob.printDialog()) {
                pjob.print();
            }
// Send print job to default printer
        } catch (FileNotFoundException ex) {
            ErrorDialog.showError(null, "No se pudo imprimir el reporte");
View Full Code Here

        Book book = new Book();
        PDFPrintPage pages = new PDFPrintPage(curFile);
        book.append(pages, pformat, curFile.getNumPages());

        pjob.setPageable(book);
        if (pjob.printDialog()) {
            new PrintThread(pages, pjob).start();
        }
    }

    /**
 
View Full Code Here

    }

    //setup printjob.
    printJob.setPrintable(gprinter, myPageFormat);

    if (printJob.printDialog()) {
      try {
        printJob.print();
      }
      catch (Exception ex) {
        LOG.error(ex);
View Full Code Here

        //
        // If required, pop up a dialog to select the printer
        //
        Boolean showPrinterDialog = (Boolean)hints.get(KEY_SHOW_PRINTER_DIALOG);
        if(showPrinterDialog != null && showPrinterDialog.booleanValue()){
            if(!printerJob.printDialog()){
                // Dialog was cancelled, meaning that the print process
                // should be stopped.
                return;
            }
        }
View Full Code Here

        AbstractGraph graph = editor.getGraph();
        if (graph != null)
        {
            PrinterJob printJob = PrinterJob.getPrinterJob();
            printJob.setPrintable(graph);
            if (printJob.printDialog())
            {
                try
                {
                    printJob.print();
                } catch (PrinterException e)
View Full Code Here

            printJob.setPrintable(graph);
            PageFormat oldPage = new PageFormat();
            PageFormat pageFormat = printJob.pageDialog(oldPage);
            if (oldPage != pageFormat)
            {
                if (printJob.printDialog())
                {
                    try
                    {
                        printJob.print();
                    } catch (PrinterException e)
View Full Code Here

        final PrinterJob pj = PrinterJob.getPrinterJob();
        // Not necessary, Pageable gets a Printable.
        // pj.setPrintable(renderer);
        pj.setPageable(this.renderer);

        if (pj.printDialog()) {
            try {
                pj.print();
            } catch (final PrinterException pe) {
                JOptionPane.showMessageDialog(this, pe.getMessage(), "Printer Error",
                        JOptionPane.ERROR_MESSAGE);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.