javafx Basic printing

Download javafx for free


PrinterJob pJ = PrinterJob.createPrinterJob();

if (pJ != null) {
    boolean success = pJ.printPage(some-node);
    if (success) {

This prints to the default printer without showing any dialog to the user. To use a printer other than the default you can use the PrinterJob#createPrinterJob(Printer) to set the current printer. You can use this to view all printers on your system:

Printing with system dialog