日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java6打印机不能用_高分求解:java中调用的打印机在什么情况下不可用?

發布時間:2025/3/12 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java6打印机不能用_高分求解:java中调用的打印机在什么情况下不可用? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

java文檔中說PrinterJob類中的getPrinterJob()方法無論返回的打印機是否可用都不會返回一個null值。我查閱過一些文獻有介紹說可以用getPrintService()方法測試返回的數值是否為null來...

java文檔中說PrinterJob類中的getPrinterJob()方法無論返回的打印機是否可用都不會返回一個null值。我查閱過一些文獻有介紹說可以用getPrintService()方法測試返回的數值是否為null來判斷打印機是否可用。

但是我不明白的是,在什么情況下打印機不可用?高分求解詳細的解答。

java文檔參考原文:

PrinterJob java.awt.print.PrinterJob.getPrinterJob()

"

Creates and returns a PrinterJob which is initially associated with the default printer. If no printers are available on the system, a PrinterJob will still be returned from this method, but getPrintService() will return null, and calling print with this PrinterJob might generate an exception. Applications that need to determine if there are suitable printers before creating a PrinterJob should ensure that the array returned from lookupPrintServices is not empty.

"

相關文檔原文參考:

"

One point you should keep in mind is that sometimes a printer may not be available on the machine on which your code is running.In this case the getPrintService() method will return null,so it's a good idea to call the method and test the reference that is returned,even if you don't want to obtain details of the printer.

"

請排除打印機損壞的情況。

展開

總結

以上是生活随笔為你收集整理的java6打印机不能用_高分求解:java中调用的打印机在什么情况下不可用?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。