如何在不丢失控件的情况下打印发票

时间:2019-07-07 22:22:17

标签: javafx printers printdialog

我正在尝试通过将Java程序中的多个控件添加到窗格中,然后将该窗格插入到我的打印机作业页面中来打印多个控件,该页面正在打印,但是当我单击“打印”时,所有已打印的控件将从场景中消失< / p>

PrinterJob job = PrinterJob.createPrinterJob();

BorderPane bpToPrint = new BorderPane();
bpToPrint.setCenter(tvGuestInvoiceOptionalServices);
bpToPrint.setLeft(txtPaymentAmount);
bpToPrint.setRight(dpGuestInvoiceCheckOutDate);
bpToPrint.setTop(cmbGuestInvoiceGuestName);
bpToPrint.setBottom(txtReportsTotalRevenu);

 if(job.showPrintDialog(OntBill.stage.getOwner()) && 
  job.printPage(bpToPrint))
        job.endJob();

0 个答案:

没有答案