Package java.awt.print

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



                                try {
                                        PrinterJob printer = PrinterJob.getPrinterJob();
                                        PageFormat pageFormat = new PageFormat();
                                        printer.pageDialog(pageFormat);
                                        PageableText pageableText;
                                        try {
                                                pageableText = new PageableText(new File(reportFilename), pageFormat);
                                                printer.setPageable(pageableText);
                                                printer.print();
View Full Code Here


        // Set the default options.  CraigM: 31/03/2008.
        pf.setOrientation(PrintUtilities.getDefaultPrintOptions().getOrientation());
        pf.setPaper(PrintUtilities.getDefaultPrintOptions().getPaper());

        // Show page format dialog with page format settings.
        pf = pjob.pageDialog(pf);
       
        // Update the default options.  CraigM: 31/03/2008.
        PrintUtilities.getDefaultPrintOptions().setOrientation(pf.getOrientation());
        PrintUtilities.getDefaultPrintOptions().setPaper(pf.getPaper());
    }
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                View view = app.getCurrentView();

                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();
View Full Code Here

                            app.showError("PrintingFailed", ex);
                        }
                    }
                } 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();
View Full Code Here

        //
        // If required, pop up a dialog to adjust the page format
        //
        Boolean showPageFormat = (Boolean)hints.get(KEY_SHOW_PAGE_DIALOG);
        if(showPageFormat != null && showPageFormat.booleanValue()){
            PageFormat tmpPageFormat = printerJob.pageDialog(pageFormat);
            if(tmpPageFormat == pageFormat){
                // Dialog was cancelled, meaning that the print process should
                // be stopped.
                return;
            }
View Full Code Here

    }
    else
    {
      final PrinterJob pj = PrinterJob.getPrinterJob();
      final PageFormat original = originalPageDef.getPageFormat(0);
      final PageFormat pf = pj.validatePage(pj.pageDialog(original));
      if (PageFormatFactory.isEqual(pf, original))
      {
        return;
      }
View Full Code Here

        //
        // If required, pop up a dialog to adjust the page format
        //
        Boolean showPageFormat = (Boolean)hints.get(KEY_SHOW_PAGE_DIALOG);
        if ((showPageFormat != null) && (showPageFormat.booleanValue())) {
            PageFormat tmpPageFormat = printerJob.pageDialog(pageFormat);
            if(tmpPageFormat == pageFormat){
                // Dialog was cancelled, meaning that the print process should
                // be stopped.
                return;
            }
View Full Code Here

        //
        // If required, pop up a dialog to adjust the page format
        //
        Boolean showPageFormat = (Boolean)hints.get(KEY_SHOW_PAGE_DIALOG);
        if(showPageFormat != null && showPageFormat.booleanValue()){
            PageFormat tmpPageFormat = printerJob.pageDialog(pageFormat);
            if(tmpPageFormat == pageFormat){
                // Dialog was cancelled, meaning that the print process should
                // be stopped.
                return;
            }
View Full Code Here

    public void doPrinting() {

        PrinterJob job = PrinterJob.getPrinterJob();

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

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

        if ( ok ) {
View Full Code Here

    /**
     * Posts the Page Setup dialog
     */
    public void doPageSetup() {
        PrinterJob pjob = PrinterJob.getPrinterJob();
        pformat = pjob.pageDialog(pformat);
    }

    /**
     * A thread for printing in.
     */
 
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.