Discovering the default print service

suggest change

To discovery the default print service, we can use the PrintServiceLookup class. Let’s see how::

import javax.print.PrintService;
import javax.print.PrintServiceLookup;

public class DiscoveringDefaultPrintService {

    public static void main(String[] args) {

    public static void discoverDefaultPrintService() {
        PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
        System.out.println("Default print service name: " + defaultPrintService.getName());


Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents