0

I need help rating printing. in fact I would like to print all the contents of my tableview but the following code that I made prints that the data that appeared on the screen the others below do not appear.

printTestButton.setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent e){  
              Printer printer = Printer.getDefaultPrinter();
              Stage dialogStage = new Stage(StageStyle.DECORATED);
              PrinterJob job = PrinterJob.createPrinterJob(printer);
              if (job != null) {
                 boolean showDialog =job.showPrintDialog(printTestButton.getScene().getWindow());
                //  boolean showDialog = job.showPageSetupDialog(dialogStage);
                  if (showDialog) {
                      tableview.setScaleX(0.50);
                      tableview.setScaleY(0.60);
                      tableview.setTranslateX(-210);
                      tableview.setTranslateY(-80);
                      boolean success = job.printPage(tableview);
                      if (success) {
                          job.endJob();
                      }
                      tableview.setTranslateX(0);
                      tableview.setTranslateY(0);
                      tableview.setScaleX(1.0);
                      tableview.setScaleY(1.0);
                  }

              }
          }
      });
Maverick283
  • 1,284
  • 3
  • 16
  • 33
BAKR ABOU
  • 1
  • 4
  • Possible duplicate: https://stackoverflow.com/questions/16738106/print-contents-of-javafx-tableview. or https://stackoverflow.com/questions/31918959/javafx-print-tableview-on-multiple-pages?rq=1 – SedJ601 Oct 04 '17 at 13:20
  • ok merci le ga, la deuxième solution est cool mais avant de lancer l'impression, la table de vue diminue mais ne reprend pas sa taille normale après l'impression. – BAKR ABOU Oct 04 '17 at 14:21
  • Essayez avec cette orthographe : aider moi au lieu de me rediriger vers d'autres truc ç'est pas la même et on à pas les même code ahhhhhhh. help me instead of redirecting me to other stuff it's not the same and we do not have the same code ahhhhhhh. – BAKR ABOU Oct 04 '17 at 16:25
  • You may not have the same code, but the solution to the problem is the same. – SedJ601 Oct 04 '17 at 16:36

0 Answers0