changeset 776:b0c446712fae

6665212: PrinterJob class, method lookupStreamPrintServices(), "fos" in docs is unknown Reviewed-by: tdv, prr
author jgodinez
date Mon, 08 Dec 2008 10:23:53 -0800
parents 15435c60c751
children b163d898f83f
files src/share/classes/java/awt/print/PrinterJob.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/print/PrinterJob.java	Thu Dec 04 11:21:26 2008 -0800
+++ b/src/share/classes/java/awt/print/PrinterJob.java	Mon Dec 08 10:23:53 2008 -0800
@@ -117,15 +117,18 @@
      * FileOutputStream outstream;
      * StreamPrintService psPrinter;
      * String psMimeType = "application/postscript";
+     * PrinterJob pj = PrinterJob.getPrinterJob();
      *
      * StreamPrintServiceFactory[] factories =
      *     PrinterJob.lookupStreamPrintServices(psMimeType);
      * if (factories.length > 0) {
      *     try {
      *         outstream = new File("out.ps");
-     *         psPrinter =  factories[0].getPrintService(fos);
+     *         psPrinter =  factories[0].getPrintService(outstream);
      *         // psPrinter can now be set as the service on a PrinterJob
-     *     } catch (FileNotFoundException e) {
+     *         pj.setPrintService(psPrinter)
+     *     } catch (Exception e) {
+     *         e.printStackTrace();
      *     }
      * }
      * </pre>