Package java.awt.print

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


        //PageFormat pageFormat = job.defaultPage();
        //job.setPrintable(plot, pageFormat);
        job.setPrintable(plot);

        if (job.printDialog()) {
            try {
                // job.print() eventually
                // calls PlotBox.print(Graphics, PageFormat)
                job.print();
            } catch (Exception ex) {
View Full Code Here


                // rbeyer@LPL.Arizona.EDU: Get the Page Format and use it.
                //PageFormat format = job.pageDialog(job.defaultPage());
                //job.setPrintable(PlotBox.this, format);
                job.setPrintable(PlotBox.this);

                if (job.printDialog(aset)) {
                    try {
                        job.print(aset);
                    } catch (Exception ex) {
                        Component ancestor = getTopLevelAncestor();
                        JOptionPane.showMessageDialog(ancestor,
View Full Code Here

                if ((view != null) && view instanceof Printable) {
                    PrinterJob job = PrinterJob.getPrinterJob();
                    PageFormat format = job.pageDialog(job.defaultPage());
                    job.setPrintable((Printable) view, format);

                    if (job.printDialog()) {
                        try {
                            job.print();
                        } catch (Exception ex) {
                            app.showError("PrintingFailed", ex);
                        }
View Full Code Here

                } else if ((view != null) && view instanceof Pageable) {
                    PrinterJob job = PrinterJob.getPrinterJob();
                    job.pageDialog(job.defaultPage());
                    job.setPageable((Pageable) view);

                    if (job.printDialog()) {
                        try {
                            job.print();
                        } catch (Exception ex) {
                            app.showError("PrintingFailed", ex);
                        }
View Full Code Here

              pg.drawString(aEEG.loadKDatei(), 50, 50);
              return Printable.PAGE_EXISTS;
            }
          });

          if (pjob.printDialog() == false)
            return;
          pjob.print();
        } catch (PrinterException pe) {
          pe.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

        // If required, pop up a dialog to select the printer
        //
        Boolean showPrinterDialog;
        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

        //
        // 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

    /** 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

        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
        PageFormat pf = job.pageDialog( aset );

        job.setPrintable( this, pf );
        boolean ok = job.printDialog( aset );

        if ( ok ) {

            try {
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.