如何在 中显示设备上安装的所有打印机Java
?
到目前为止找到我使用的打印机:
PrintUtility.findPrintService(printer); //Selects any printer with the name provided
PrintService[] services = PrintServiceLookup.lookupPrintServices(psInFormat, null);
//System.out.println("Printers avialiable are " + services);
System.out.println("Printer Selected " + services[Printerinx]);
但我希望在控制台中显示所有打印机。我怎样才能做到这一点?