提交 8db4236d 编写于 作者: J jgodinez

6665212: PrinterJob class, method lookupStreamPrintServices(), "fos" in docs is unknown

Reviewed-by: tdv, prr
上级 2009cbeb
...@@ -117,15 +117,18 @@ public abstract class PrinterJob { ...@@ -117,15 +117,18 @@ public abstract class PrinterJob {
* FileOutputStream outstream; * FileOutputStream outstream;
* StreamPrintService psPrinter; * StreamPrintService psPrinter;
* String psMimeType = "application/postscript"; * String psMimeType = "application/postscript";
* PrinterJob pj = PrinterJob.getPrinterJob();
* *
* StreamPrintServiceFactory[] factories = * StreamPrintServiceFactory[] factories =
* PrinterJob.lookupStreamPrintServices(psMimeType); * PrinterJob.lookupStreamPrintServices(psMimeType);
* if (factories.length > 0) { * if (factories.length > 0) {
* try { * try {
* outstream = new File("out.ps"); * 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 * // psPrinter can now be set as the service on a PrinterJob
* } catch (FileNotFoundException e) { * pj.setPrintService(psPrinter)
* } catch (Exception e) {
* e.printStackTrace();
* } * }
* } * }
* </pre> * </pre>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册