/** * pageDialog() displays a page setup dialog. */ public void pageDialog() { pFormat = pJob.pageDialog(pFormat); }
/** * Brings up the page dialog. */ protected void pageDialog() { m_PageFormat = m_PrinterJob.pageDialog(m_PageFormat); }
/** * Brings up the page dialog. */ protected void pageDialog() { m_PageFormat = m_PrinterJob.pageDialog(m_PageFormat); }
/** * Posts the Page Setup dialog */ public void doPageSetup() { PrinterJob pjob = PrinterJob.getPrinterJob(); pformat = pjob.pageDialog(pformat); }
/** * Posts the Page Setup dialog */ public void doPageSetup() { PrinterJob pjob = PrinterJob.getPrinterJob(); pformat = pjob.pageDialog(pformat); }
/** * Concerne uniquement le bouton de modification du format de la page. */ public void actionPerformed(final ActionEvent _ae) { final String com = _ae.getActionCommand(); if ("MODIFIER".equals(com)) { pageFormat_ = PrinterJob.getPrinterJob().pageDialog(pageFormat_); majPanelPageFormat(); } }
@Override public void actionPerformed(@Nonnull final ActionEvent e) { pageFormat = printerJob.pageDialog(pageFormat); splitToPagesForCurrentFormat(); scrollPane.revalidate(); scrollPane.getViewport().revalidate(); scrollPane.repaint(); } });
public static void pageSetup(View view) { PrinterJob prnJob = getPrintJob("PageSetupOnly"); if(prnJob.pageDialog(format)!=null) savePrintSpec(); } //}}}
public void actionPerformed(ActionEvent event) { PrinterJob job = PrinterJob.getPrinterJob(); PageFormat newPageFormat = job.pageDialog(attributes); if (newPageFormat != null) pageFormat = newPageFormat; canvas.repaint(); } });
public void pageDialog() { this.pageFormat = getPrinterJob().pageDialog(getPageFormat()); Paper paper = pageFormat.getPaper(); StringBuilder sb = new StringBuilder(); NumberFormat format = DecimalFormat.getInstance(Locale.US); double paperWidth = paper.getWidth(); sb.append(format.format(paperWidth)).append(' '); double paperHeight = paper.getHeight(); sb.append(format.format(paperHeight)).append(' '); double imageableX = paper.getImageableX(); sb.append(format.format(imageableX)).append(' '); double imageableY = paper.getImageableY(); sb.append(format.format(imageableY)).append(' '); double imageableWidth = paper.getImageableWidth(); sb.append(format.format(imageableWidth)).append(' '); double imageableHeight = paper.getImageableHeight(); sb.append(format.format(imageableHeight)).append(' '); int pageFormatOrientation = pageFormat.getOrientation(); sb.append(format.format(pageFormatOrientation)).append(' '); ResourceController.getResourceController().setProperty("pageSettings", sb.toString()); }
JFrame yourComponent = new JFrame(); PrinterJob pjob = PrinterJob.getPrinterJob(); PageFormat preformat = pjob.defaultPage(); preformat.setOrientation(PageFormat.LANDSCAPE); PageFormat postformat = pjob.pageDialog(preformat); //If user does not hit cancel then print. if (preformat != postformat) { //Set print component pjob.setPrintable(new Printer(yourComponent), postformat); if (pjob.printDialog()) { pjob.print(); } }
JFrame yourComponent = new JFrame(); PrinterJob pjob = PrinterJob.getPrinterJob(); PageFormat preformat = pjob.defaultPage(); preformat.setOrientation(PageFormat.LANDSCAPE); PageFormat postformat = pjob.pageDialog(preformat); if (preformat != postformat) { pjob.setPrintable(new Printer(yourComponent), postformat); if (pjob.printDialog()) { pjob.print(); } }
public synchronized void performAction() { PrintSettings ps = (PrintSettings) PrintSettings.findObject(PrintSettings.class, true); PrinterJob pj = PrinterJob.getPrinterJob(); ps.setPageFormat(pj.pageDialog(PrintSettings.getPageFormat(pj))); }
public synchronized void performAction() { PrintSettings ps = (PrintSettings) PrintSettings.findObject(PrintSettings.class, true); PrinterJob pj = PrinterJob.getPrinterJob(); ps.setPageFormat(pj.pageDialog(PrintSettings.getPageFormat(pj))); }
/** * Creates a print job for the chart. */ public void createChartPrintJob() { PrinterJob job = PrinterJob.getPrinterJob(); PageFormat pf = job.defaultPage(); PageFormat pf2 = job.pageDialog(pf); if (pf2 != pf) { job.setPrintable(this, pf2); if (job.printDialog()) { try { job.print(); } catch (PrinterException e) { JOptionPane.showMessageDialog(this, e); } } } }
/** * Creates a print job for the chart. */ public void createChartPrintJob() { PrinterJob job = PrinterJob.getPrinterJob(); PageFormat pf = job.defaultPage(); PageFormat pf2 = job.pageDialog(pf); if (pf2 != pf) { job.setPrintable(this, pf2); if (job.printDialog()) { try { job.print(); } catch (PrinterException e) { JOptionPane.showMessageDialog(this, e); } } } }
/** * @return <tt>null</tt> Shows pageDialog, however. */ public java.awt.Component getCustomEditor() { PageFormat pf = (PageFormat) getValue(); PrinterJob pj = PrinterJob.getPrinterJob(); PageFormat npf = pj.pageDialog(pf); //setValue(npf); ((PrintSettings) PrintSettings.findObject(PrintSettings.class)).setPageFormat((PageFormat) npf.clone()); pj.cancel(); return null; } }
/** * @return <tt>null</tt> Shows pageDialog, however. */ public java.awt.Component getCustomEditor() { PageFormat pf = (PageFormat) getValue(); PrinterJob pj = PrinterJob.getPrinterJob(); PageFormat npf = pj.pageDialog(pf); //setValue(npf); ((PrintSettings) PrintSettings.findObject(PrintSettings.class)).setPageFormat((PageFormat) npf.clone()); pj.cancel(); return null; } }
PrinterJob pjob = PrinterJob.getPrinterJob(); PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); PageFormat pfDefault = pjob.pageDialog(aset); pjob.setJobName(file.getName()); pages.show(pjob); if (pjob.printDialog(aset)) { pfDefault = pjob.validatePage(pfDefault); Book book = new Book(); book.append(pages, pfDefault, pdfFile.getNumPages()); pjob.setPageable(book); try { pjob.print(aset); } catch (PrinterException exc) { System.out.println(exc); }
public static void pageSetup(View view) { job = getPrintJob(); PageFormat newFormat = job.pageDialog(format); if(newFormat != null) { format = newFormat; jEdit.setIntegerProperty("print.orientation",format.getOrientation()); Paper paper=format.getPaper(); jEdit.setDoubleProperty("print.width",paper.getImageableWidth()); jEdit.setDoubleProperty("print.height",paper.getImageableHeight()); jEdit.setDoubleProperty("print.x",paper.getImageableX()); jEdit.setDoubleProperty("print.y",paper.getImageableY()); jEdit.setDoubleProperty("print.pagewidth",paper.getWidth()); jEdit.setDoubleProperty("print.pageheight",paper.getHeight()); } } //}}}