Advertisement
Guest User

How do I get a list of installed printers

a guest
Feb 27th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement