Printer Availablity
<p>Here i have coded to get a list of devices and i will check each devices status </p>

<pre><code>DocFlavor myFormat = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
PrintService[] services =PrintServiceLookup.lookupPrintServices(myFormat, aset);
System.out.println("The following printers are available");
for (int i=0;i&lt;services.length;i++) {
    PrintService printService = services[i];
    PrintServiceAttributeSet printServiceAttributes = printService.getAttributes();
    PrinterState printerState = 
                      (PrinterState)printServiceAttributes.get(PrinterState.class);
    if (printerState != null){
            System.out.println(services[i].getName() + " is online");
    } else {
            System.out.println(services[i].getName() + " is offline");
    }
}
</code></pre>

<p>But the problem is each and every time i got a status "Offline" even that printer is Switched on or Switched off </p>
