Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

How do I get a list of installed printers

By: a guest on Feb 27th, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import javax.print.*;
  2.  
  3. class Test {
  4.  
  5.     public static void main (String [] args)
  6.     {
  7.         PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
  8.         System.out.println("Number of print services: " + printServices.length);
  9.  
  10.         for (PrintService printer : printServices)
  11.             System.out.println("Printer: " + printer.getName());
  12.     }
  13. }