Examples of pageDialog()


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

        public static void main(String[] args) throws IOException, PrinterException {
                // Get the PrinterJob object that coordinates everything
                PrinterJob job = PrinterJob.getPrinterJob();

                // Get the default page format, then ask the user to customize it
                PageFormat format = job.pageDialog(job.defaultPage());

                // Create our PageableText object, and tell the PrinterJob about it
                job.setPageable(new PageableText(new File(args[0]), format));

                // Ask the user to select a printer, etc., and if not canceled, print!
View Full Code Here

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

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

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

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

            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

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

                            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

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

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

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

    }
    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

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

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

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

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

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

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