Hi an alle!
Was muss in der Zeile "process(service, attrName, attrValue);" nun stehen? ( siehe unten im Zitat, wo ??? steht! )
Ich weiss nur nicht, was mit "process" gemeint ist!
Ausschnitt von hier
Gruß
Iron Monkey
Was muss in der Zeile "process(service, attrName, attrValue);" nun stehen? ( siehe unten im Zitat, wo ??? steht! )
Ich weiss nur nicht, was mit "process" gemeint ist!
Ausschnitt von hier
e713. Listening for Print Service Status Changes
Examples of print service status include PrinterIsAcceptingJobs (indicates if a print service will accept new print jobs) and QueuedJobCount (the number of print jobs to be processed by the print service). Use a PrintServiceAttributeListener to get status changes on a print server. This example adds a listener to all print services. To obtain detailed status changes for a print job, see e714 Listening for Print Job Status Changes.
Java:// Add a listener to all print services PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null); for (int i=0; i<services.length; i++) { services[i].addPrintServiceAttributeListener(new MyPrintServiceAttributeListener()); } class MyPrintServiceAttributeListener implements PrintServiceAttributeListener { public void attributeUpdate(PrintServiceAttributeEvent psae) { // Some event occurred with a print service PrintService service = psae.getPrintService(); Attribute[] attrs = psae.getAttributes().toArray(); for (int i=0; i<attrs.length; i++) { String attrName = attrs[i].getName(); // New value String attrValue = attrs[i].toString(); process(service, attrName, attrValue); // <--- ??? } } }
Gruß
Iron Monkey