• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List of Printers in client machine -Java

 
Rayudu addagarla
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to retrieve the list of printers attached to the clients machine, thru. my java application.
Is there any method in Java API which returns the list of printers attached. If there is any third party tool which supports this, pl. suggest...
Actuall an Applet should be able to do this.
thanks
if some one can mail me at rayuduak@yahoo.com i would appreciate
 
Jeff Yung
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import javax.print.PrintService;

PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);

// Get the printer name
for(int i=0;i<services.length;i++) {
String name = services[0].getName();
System.out.println("printer="+name);
}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic