< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java

Print this page

        

*** 476,488 **** if (attributes == null) { return false; } DialogOwner dlgOwner = (DialogOwner)attributes.get(DialogOwner.class); ! Frame ownerFrame = (dlgOwner != null) ? dlgOwner.getOwner() : null; - WPrintDialog dialog = new WPrintDialog(ownerFrame, this); dialog.setRetVal(false); dialog.setVisible(true); boolean prv = dialog.getRetVal(); dialog.dispose(); --- 476,491 ---- if (attributes == null) { return false; } DialogOwner dlgOwner = (DialogOwner)attributes.get(DialogOwner.class); ! Window owner = (dlgOwner != null) ? dlgOwner.getOwner() : null; ! ! WPrintDialog dialog = (owner instanceof Frame) ? ! new WPrintDialog((Frame)owner, this) : ! new WPrintDialog((Dialog)owner, this); dialog.setRetVal(false); dialog.setVisible(true); boolean prv = dialog.getRetVal(); dialog.dispose();
*** 496,507 **** ResourceBundle rb = ResourceBundle.getBundle(strBundle); try { title = rb.getString("dialog.printtofile"); } catch (MissingResourceException e) { } ! FileDialog fileDialog = new FileDialog(ownerFrame, title, ! FileDialog.SAVE); URI destURI = dest.getURI(); // Old code destURI.getPath() would return null for "file:out.prn" // so we use getSchemeSpecificPart instead. String pathName = (destURI != null) ? --- 499,511 ---- ResourceBundle rb = ResourceBundle.getBundle(strBundle); try { title = rb.getString("dialog.printtofile"); } catch (MissingResourceException e) { } ! FileDialog fileDialog = (owner instanceof Frame) ? ! new FileDialog((Frame)owner, title, FileDialog.SAVE) : ! new FileDialog((Dialog)owner, title, FileDialog.SAVE); URI destURI = dest.getURI(); // Old code destURI.getPath() would return null for "file:out.prn" // so we use getSchemeSpecificPart instead. String pathName = (destURI != null) ?
*** 529,542 **** while ((f.exists() && (!f.isFile() || !f.canWrite())) || ((pFile != null) && (!pFile.exists() || (pFile.exists() && !pFile.canWrite())))) { ! (new PrintToFileErrorDialog(ownerFrame, ServiceDialog.getMsg("dialog.owtitle"), ServiceDialog.getMsg("dialog.writeerror")+" "+fullName, ServiceDialog.getMsg("button.ok"))).setVisible(true); fileDialog.setVisible(true); fileName = fileDialog.getFile(); if (fileName == null) { fileDialog.dispose(); --- 533,553 ---- while ((f.exists() && (!f.isFile() || !f.canWrite())) || ((pFile != null) && (!pFile.exists() || (pFile.exists() && !pFile.canWrite())))) { ! if (owner instanceof Frame) { ! (new PrintToFileErrorDialog((Frame)owner, ! ServiceDialog.getMsg("dialog.owtitle"), ! ServiceDialog.getMsg("dialog.writeerror")+" "+fullName, ! ServiceDialog.getMsg("button.ok"))).setVisible(true); ! } else { ! (new PrintToFileErrorDialog((Dialog)owner, ServiceDialog.getMsg("dialog.owtitle"), ServiceDialog.getMsg("dialog.writeerror")+" "+fullName, ServiceDialog.getMsg("button.ok"))).setVisible(true); + } fileDialog.setVisible(true); fileName = fileDialog.getFile(); if (fileName == null) { fileDialog.dispose();
< prev index next >