title: JavaFX (OpenJFX) not letting me print
body: <p>My JavaFX program prepares and prints out a set of VBoxes.</p>
  
  <p>This is ModPrintCycle. It is the Window that gives the options to print</p>
  
  <pre><code>public PrintCycle data;
      //PrintCycle is a HashMap of VBoxes containing all the details
  PrinterJob pj;
  ChoiceBox&lt;String&gt; cbxPrinters = new ChoiceBox&lt;String&gt;();
  ArrayList&lt;Printer&gt; arrPrinters = new ArrayList&lt;Printer&gt;();
  
  //util.say just pops out a messagebox attached to ModPrintCycle.
  
  public void printAll(ArrayList&lt;String&gt; pageList){
      if(cbxPrinters.getSelectionModel().getSelectedIndex() &gt;=0){
          if (data.tables.size() &gt; 0){
              Printer curP = Printer.getDefaultPrinter();
                  if(arrPrinters.size() &gt; 0 ){
                      curP = arrPrinters.get(cbxPrinters.getSelectionModel().getSelectedIndex());
                  }
                  try{
                      pj = PrinterJob.createPrinterJob(curP);
                      PageLayout pp = curP.createPageLayout(Paper.LEGAL, PageOrientation.PORTRAIT, MarginType.DEFAULT);
                      PageLayout pl = curP.createPageLayout(Paper.LEGAL, PageOrientation.LANDSCAPE, MarginType.DEFAULT);
  
                      for(String p : pageList){
                          Printable pt = data.tables.get(p);
                          pt.scaleToFit();
                          if(pt.isLandscape()){
                              pj.printPage(pl,pt);    
                          }
                          else{
                              pj.printPage(pp,pt);
                          }   
                      }
  
                      pj.endJob();
                  }catch(Exception e){
                      util.say(ModPrintCycle.this, "Error on Print"); 
                  }   
          }else{
              util.say(ModPrintCycle.this, "Nothing to print");
          }
      }
      else{
          util.say(ModPrintCycle.this, "No Printer Selected");
      }
  }
  </code></pre>
  
  <p>Printer is installed and set as default, and my program detects it. But when I print, no errors pop out, and the printer receives no jobs.</p>
  
  <p>I'm sure my program worked before (A Lubuntu 15.10, 32-bit.). But now, I transfered it to a different computer. A Lubuntu 15.10, 64-bit. I have openjfx and openjdk version "1.8.0_66-internal" installed.</p>
  
  <p>What can I do to find out why it's not printing? </p>
  
  <hr>
  
  <p>Tried to make a smaller print job, but to the same effect.</p>
  
  <pre><code>Button testPrint = new Button("Test Print");
  
      testPrint.setOnAction(new EventHandler&lt;ActionEvent&gt;(){
  
          @Override
          public void handle(ActionEvent arg0) {
              try{
                  Printer p = Printer.getDefaultPrinter();
                  PrinterJob pj = PrinterJob.createPrinterJob(p);
                  //util.say(ModShortcuts.this, "Print: " + pj.getJobStatus());
                  Boolean k = pj.printPage(p.createPageLayout(Paper.LEGAL,PageOrientation.PORTRAIT,MarginType.DEFAULT), new Text("Hey"));
                  //util.password(); //reused for a showAndWait() dialog
                  //util.say(ModShortcuts.this, "Print: " + pj.getJobStatus());
                  //util.say(ModShortcuts.this, "attempted Print using: " + pj.getPrinter().getName());
  
  
                  if(k){
                      //util.say(ModShortcuts.this, "Print: " + pj.getJobStatus());
                      pj.endJob();
                      //util.say(ModShortcuts.this, "Print: " + pj.getJobStatus());
                  }
  
              }catch(Exception e){
                  e.printStackTrace();
              }
  
          }
  
      });
  
      vbox.getChildren().add(testPrint);
  </code></pre>
  
  <p>Uncommented, the output is</p>
  
  <pre><code>Print: Not Printing
  Print: Printing
  attempted Print using: AstinePrinter
  Print: Printing
  Print: Done
  </code></pre>
  
  <p>AstinePrinter is the name of my printer.</p>
  
  <hr>
  
  <p>Edit: Using</p>
  
  <pre><code>sudo add-apt-repository ppa:webupd8team/java
  sudo apt-get update
  sudo apt-get install oracle-java8-installer 
  </code></pre>
  
  <p>I installed Oracle Java 8, and still the same problem.</p>
  
  <p>Edit: Also Oracle Java 7.</p>
  
  <p>Edit:</p>
  
  <p>Tried disabling the firewall, in case it was a port problem</p>
  
  <pre><code>sudo ufw disable
  </code></pre>
  
  <p>Still nothing.</p>