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

Reviewed-by: tdv, prr
This commit is contained in:
Jennifer Godinez 2008-12-08 10:23:53 -08:00
parent 5d3228cbb3
commit 2f8d598ab1

View File

@ -117,15 +117,18 @@ public abstract class PrinterJob {
* 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>