⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e714. listening for print job status changes.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
In order to get status on a print job, a print job listener must be added to the print job before it is submitted to the print service. These status changes are common to all print jobs. A print service may support other types of print job status changes and these are delivered through a print job attribute listener rather than a print job listener; see e715 Listening for Print Job Attribute Changes. 
    // Create the print job
    DocPrintJob job = service.createPrintJob();
    job.addPrintJobListener(new MyPrintJobListener());
    
    class MyPrintJobListener implements PrintJobListener {
        public void printDataTransferCompleted(PrintJobEvent pje) {
            // The print data has been transferred to the print service
        }
    
        public void printJobCanceled(PrintJobEvent pje) {
            // The print job was cancelled
        }
    
        public void printJobCompleted(PrintJobEvent pje) {
            // The print job was completed
        }
    
        public void printJobFailed(PrintJobEvent pje) {
            // The print job has failed
        }
    
        public void printJobNoMoreEvents(PrintJobEvent pje) {
            // No more events will be delivered from this
            // print service for this print job.
            // This event is fired in cases where the print service
            // is not able to determine when the job completes.
        }
    
        public void printJobRequiresAttention(PrintJobEvent pje) {
            // The print service requires some attention to repair
            // some problem. E.g. running out of paper would
            // cause this event to be fired.
        }
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -