这里面包含了一百多个JAVA源文件

源代码在线查看: e715. listening for print job attribute changes.txt

软件大小: 551 K
上传用户: maple_78
关键词: JAVA
下载地址: 免注册下载 普通下载 VIP

相关代码

				Status changes that are common to all print jobs are delivered through a print job listener; see e714 Listening for Print Job Status Changes. However, if a print service supports a status that is not supported by the print job listener (e.g., JobMediaSheetsCompleted), it delivers status changes through a print job attribute listener. 
				    // Create the print job
				    DocPrintJob job = service.createPrintJob();
				    PrintJobAttributeSet set = new HashPrintJobAttributeSet(job.getAttributes());
				    set.add(new JobMediaSheetsCompleted(0));
				    job.addPrintJobAttributeListener(new MyPrintJobAttributeListener(), set);
				    
				    class MyPrintJobAttributeListener implements PrintJobAttributeListener {
				        public void attributeUpdate(PrintJobAttributeEvent pjae) {
				            // Get the set of attributes that have changed
				            Attribute[] attrs = pjae.getAttributes().toArray();
				    
				            for (int i=0; i				                String attrName = attrs[i].getName();
				                String attrValue = attrs[i].toString();
				                process(pjae, attrName, attrValue);
				            }
				        }
				    }
				
							

相关资源