6665212: PrinterJob class, method lookupStreamPrintServices(), "fos" in docs is unknown
authorjgodinez
Mon, 08 Dec 2008 10:23:53 -0800
changeset 1740 fb0972d6e026
parent 1739 ed98610896e7
child 1741 f02cad8a9114
6665212: PrinterJob class, method lookupStreamPrintServices(), "fos" in docs is unknown Reviewed-by: tdv, prr
jdk/src/share/classes/java/awt/print/PrinterJob.java
--- a/jdk/src/share/classes/java/awt/print/PrinterJob.java	Thu Dec 04 11:21:26 2008 -0800
+++ b/jdk/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>