PrinterJob job = PrinterJob.getPrinterJob(); PageFormat pf = Page.getPageFormat(); PageFormat pf2 = job.pageDialog(pf);  if (pf!=pf2) { Page.setPageFormat(pf2); loadPreview();
String str = getScaleComboBox().getSelectedItem().toString(); if (str.endsWith("%")) str = str.substring(0, str.length() - 1); str = str.trim();  int scale = 0; try { scale = Integer.parseInt(str); } catch (NumberFormatException ex) { return;
		public void run() {			PrinterJob job = PrinterJob.getPrinterJob();			PageFormat pf = Page.getPageFormat();			PageFormat pf2 = job.pageDialog(pf);						if (pf!=pf2)			{				Page.setPageFormat(pf2);				loadPreview();			}		}