Skip to content

Instantly share code, notes, and snippets.

@eliocapelati
Last active December 27, 2016 16:50
Show Gist options
  • Save eliocapelati/041a13f698a5e32945ef to your computer and use it in GitHub Desktop.
Save eliocapelati/041a13f698a5e32945ef to your computer and use it in GitHub Desktop.
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
public static void main(String ... args){
PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
System.out.println("Number of print services: " + printServices.length);
for (PrintService printer : printServices)
System.out.println("Printer: " + printer.getName());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment