Java examples for 2D Graphics:Print
get Available Printers
//package com.java2s; import javax.print.DocFlavor; import javax.print.PrintService; import javax.print.PrintServiceLookup; import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; import javax.print.attribute.standard.Copies; public class Main { public static PrintService[] getAvailablePrinters() { final PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet(); printRequestAttributeSet.add(new Copies(1)); return PrintServiceLookup.lookupPrintServices( DocFlavor.INPUT_STREAM.PNG, printRequestAttributeSet); }/*from ww w .ja v a 2 s . c o m*/ }