final Pageable target2 = target; new Thread() { public void run() {  try { PrinterJob job = PrinterJob.getPrinterJob(); job.setJobName(getTitle());  job.setPageable(target2);  if (job.printDialog()) { setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); Thread.yield(); job.print(); setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); dispose(); } } catch (PrinterException ex) { ex.printStackTrace(); com.cosylab.vdct.Console.getInstance().println("Printing error: "+ex); } } }.start();
com.cosylab.vdct.VisualDCT.getInstance().printMenuItem_ActionPerformed();
public void printToolBarButton_ActionEvents() {	final Pageable target2 = target;	new Thread() {		public void run() {						try {				PrinterJob job = PrinterJob.getPrinterJob();				job.setJobName(getTitle());				job.setPageable(target2);						if (job.printDialog())				{					setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));					Thread.yield();					job.print();					setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));					dispose();				}			} catch (PrinterException ex) {				ex.printStackTrace();				com.cosylab.vdct.Console.getInstance().println("Printing error: "+ex);			}		}	}.start();}