JavaTM 2 Platform
Standard Ed. 6

介面 javax.print.PrintService
的使用

使用 PrintService 的軟體套件
java.awt.print 為通用的列印 API 提供類別和介面。 
javax.print 為 JavaTM Print Service API 提供了主要類別和介面。 
javax.print.event 包 javax.print.event 套件含事件類別和偵聽器介面。 
javax.swing 提供一組“輕量級”(全部是 Java 語言)元件,盡量讓這些元件在所有平臺上的工作方式都相同。 
javax.swing.text 提供類別 HTMLEditorKit 和創建 HTML 文本編輯器的支持類別。 
 

java.awt.print 中 PrintService 的使用
 

返回 PrintService 的 java.awt.print 中的方法
 PrintService PrinterJob.getPrintService()
          返回此印表機作業的服務(印表機)。
static PrintService[] PrinterJob.lookupPrintServices()
          尋找 2D 列印服務的便捷方法。
 

參數型別為 PrintService 的 java.awt.print 中的方法
 void PrinterJob.setPrintService(PrintService service)
          將此 PrinterJob 與新的 PrintService 關聯。
 

javax.print 中 PrintService 的使用
 

javax.print 中 PrintService 的子介面
 interface MultiDocPrintService
          介面 MultiPrintService 是 MultiDocPrintJob 的處理器。
 

實作 PrintService 的 javax.print 中的類別
 class StreamPrintService
          此類別擴展了 PrintService 並表示這樣一種 PrintService,即以不同的格式向客戶端提供的輸出串流列印資料。
 

返回 PrintService 的 javax.print 中的方法
abstract  PrintService PrintServiceLookup.getDefaultPrintService()
          應用程序不直接調用它。
 PrintService DocPrintJob.getPrintService()
          確定此 PrintJob 物件所綁定到的 PrintService 物件。
abstract  PrintService[] PrintServiceLookup.getPrintServices()
          應用程序不直接調用它。
abstract  PrintService[] PrintServiceLookup.getPrintServices(DocFlavor flavor, AttributeSet attributes)
          尋找肯定可支持指定屬性和 DocFlavor 組合的服務。
static PrintService PrintServiceLookup.lookupDefaultPrintService()
          尋找此環境的預設 PrintService。
static PrintService[] PrintServiceLookup.lookupPrintServices(DocFlavor flavor, AttributeSet attributes)
          尋找能夠列印指定 DocFlavor 的 PrintService。
static PrintService ServiceUI.printDialog(GraphicsConfiguration gc, int x, int y, PrintService[] services, PrintService defaultService, DocFlavor flavor, PrintRequestAttributeSet attributes)
          為使用者提供一個選擇 PrintService(印表機)的對話框。
 

參數型別為 PrintService 的 javax.print 中的方法
static PrintService ServiceUI.printDialog(GraphicsConfiguration gc, int x, int y, PrintService[] services, PrintService defaultService, DocFlavor flavor, PrintRequestAttributeSet attributes)
          為使用者提供一個選擇 PrintService(印表機)的對話框。
static PrintService ServiceUI.printDialog(GraphicsConfiguration gc, int x, int y, PrintService[] services, PrintService defaultService, DocFlavor flavor, PrintRequestAttributeSet attributes)
          為使用者提供一個選擇 PrintService(印表機)的對話框。
static boolean PrintServiceLookup.registerService(PrintService service)
          允許應用程序直接註冊一個實作了 PrintService 的類別的實例。
 

javax.print.event 中 PrintService 的使用
 

返回 PrintService 的 javax.print.event 中的方法
 PrintService PrintServiceAttributeEvent.getPrintService()
          返回列印服務。
 

參數型別為 PrintService 的 javax.print.event 中的建構子
PrintServiceAttributeEvent(PrintService source, PrintServiceAttributeSet attributes)
          建構一個 PrintServiceAttributeEvent 物件。
 

javax.swing 中 PrintService 的使用
 

參數型別為 PrintService 的 javax.swing 中的方法
 boolean JTable.print(JTable.PrintMode printMode, MessageFormat headerFormat, MessageFormat footerFormat, boolean showPrintDialog, PrintRequestAttributeSet attr, boolean interactive, PrintService service)
          列印此 JTable。
 

javax.swing.text 中 PrintService 的使用
 

參數型別為 PrintService 的 javax.swing.text 中的方法
 boolean JTextComponent.print(MessageFormat headerFormat, MessageFormat footerFormat, boolean showPrintDialog, PrintService service, PrintRequestAttributeSet attributes, boolean interactive)
          列印此 JTextComponent 的內容。
 


JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。