Java examples for JavaFX:Node
Prints a JavaFX node.
//package com.java2s; import javafx.print.Printer; import javafx.print.PrinterJob; import javafx.scene.Node; public class Main { /**/*from w ww . j av a 2 s .c o m*/ * Prints a node. * * @param node The scene node to be printed. */ public static void print(final Node node) { Printer printer = Printer.getDefaultPrinter(); PrinterJob job = PrinterJob.createPrinterJob(printer); if (job != null && job.showPrintDialog(null)) { boolean success = job.printPage(node); if (success) { job.endJob(); } } } }