Example usage for javafx.print PrinterJob endJob

List of usage examples for javafx.print PrinterJob endJob

Introduction

In this page you can find the example usage for javafx.print PrinterJob endJob.

Prototype

public synchronized boolean endJob() 

Source Link

Document

If the job can be successfully spooled to the printer queue this will return true.

Usage

From source file:Main.java

private void print(Node node) {
    System.out.println("Creating a printer job...");

    PrinterJob job = PrinterJob.createPrinterJob();
    if (job != null) {
        System.out.println(job.jobStatusProperty().asString());

        boolean printed = job.printPage(node);
        if (printed) {
            job.endJob();
        } else {// ww w .j a v a2s. co m
            System.out.println("Printing failed.");
        }
    } else {
        System.out.println("Could not create a printer job.");
    }
}