PrinterJob job = PrinterJob.getPrinterJob(); job.setJobName(getTitle()); job.setPageable(pi.getPageable()); if (job.printDialog())
PrintRequestAttributeSet printRequestAttributeSet = Page.getPrintRequestAttributeSet();  PrinterJob printerJob = PrinterJob.getPrinterJob(); printerJob.setJobName(getTitle()); printerJob.setPageable(pi.getPageable());  if(!printerJob.printDialog(printRequestAttributeSet)) return;  int pageFormatOrientation = PageFormat.PORTRAIT;  OrientationRequested orientationRequested = (OrientationRequested) printRequestAttributeSet.get(OrientationRequested.class);  if(orientationRequested != null)
public void printMenuItem_ActionPerformed() {	final GetPrintableInterface pi = (GetPrintableInterface)CommandManager.getInstance().getCommand("GetPrintableInterface");	if (pi!=null)	new Thread() {		public void run() {			try {				PrinterJob job = PrinterJob.getPrinterJob();				job.setJobName(getTitle());				job.setPageable(pi.getPageable());				if (job.printDialog())				{					setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));					Thread.yield();					job.print();				}			} catch (PrinterException ex) {				ex.printStackTrace();				com.cosylab.vdct.Console.getInstance().println("Printing error: "+ex);			}			finally			{				setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));			}		}	}.start();}