Java Printer Usage getDefaultPrinterName()

Here you can find the source of getDefaultPrinterName()

Description

get Default Printer Name

License

Open Source License

Declaration

public static String getDefaultPrinterName() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.print.PrintServiceLookup;

public class Main {
    public static String getDefaultPrinterName() {
        if (PrintServiceLookup.lookupDefaultPrintService() != null) {
            return PrintServiceLookup.lookupDefaultPrintService().getName();
        }/*w w  w .j  a  v  a  2s.c  o m*/
        return ""; // no default printer specified
    }
}

Related

  1. get_print_service(String printerName, HashPrintRequestAttributeSet aset)
  2. getArrayOfPrinterNames()
  3. getAttribute( PrintService ps, Class category)
  4. getAvailablePrinters()
  5. getDefaultPrinterName()
  6. getDefaultPrintRequestAttributes()
  7. getEnumAttribute(String name, Object value)
  8. getIntegerAttribute(String name, int value)
  9. getJobPriority(int pages, int copies, boolean withDialog)