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。