e706. determining the capabilities of a print service.txt
来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 12 行
TXT
12 行
The capabilities of a print service are called print service attributes. Examples of print service attributes include: color-supported, printer-name, and queued-job-count. This example demonstrates how to retrieve the current attributes of a print service. To monitor changes to these attributes, see e713 Listening for Print Service Status Changes.
Attribute[] attrs = service.getAttributes().toArray();
for (int j=0; j<attrs.length; j++) {
String attrName = attrs[j].getName();
// Retrieve the string version of the attribute value
String attrValue = attrs[j].toString();
process(service, attrName, attrValue);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?