Swing component add to ScrollPane(JavaFX)
<p>I'm making JavaFX application which will open pdf files. I found free library for PDF Viewer but it's made in Swing. So I need to add JPanel to ScrollPane(JavaFX). I tried but without success. </p>

<p>I got this error:</p>

<p>Aug 13, 2016 9:59:09 PM org.icepdf.core.pobjects.Document 
WARNING: PDF write support was not found on the class path.</p>

<p>I found here on stackoverflow how to add swing component to javafx pane and I do that but I got this error.</p>

<p>Any suggestion is welcome.  </p>

<pre><code>package application;

import java.awt.Component;
import java.io.File;
import java.net.MalformedURLException;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import org.icepdf.ri.common.ComponentKeyBinding;
import org.icepdf.ri.common.SwingController;
import org.icepdf.ri.common.SwingViewBuilder;

import javafx.embed.swing.SwingNode;
import javafx.scene.Node;
import javafx.scene.layout.Pane;

    public class PDFView{

    public JPanel viewerComponentPanel;

    public static Node showPDF(File sFiles) throws MalformedURLException {

    String filePath = sFiles.toURI().toURL().toString();

    // build a controller
    SwingController controller = new SwingController();

    // Build a SwingViewFactory configured with the controller
    SwingViewBuilder factory = new SwingViewBuilder(controller);

    // Use the factory to build a JPanel that is pre-configured
    //with a complete, active Viewer UI.
    JPanel viewerComponentPanel = factory.buildViewerPanel();

    // add copy keyboard command
    ComponentKeyBinding.install(controller, viewerComponentPanel);

    // add interactive mouse link annotation support via callback
    controller.getDocumentViewController().setAnnotationCallback(
          new org.icepdf.ri.common.MyAnnotationCallback(
                 controller.getDocumentViewController()));


    final SwingNode swingNode = new SwingNode();
    createAndSetSwingContent(swingNode, viewerComponentPanel);


    // Open a PDF document to view
    controller.openDocument(filePath);
    return swingNode;

}

 private static void createAndSetSwingContent(final SwingNode swingNode, JPanel viewerComponentPanel) {
     SwingUtilities.invokeLater(new Runnable() {
         @Override
         public void run() {
             swingNode.setContent(viewerComponentPanel);
         }
     });
 }

}
</code></pre>

<p>This is main class where I call the method from PDFView class</p>

<pre><code>for(int i=0;i&lt;fileNumber;i++){

        choosedName=sFiles[i].getName();
        String ext=choosedName.substring(choosedName.lastIndexOf(".") + 1);

        switch (ext) {
        case "doc":  
                 break;
        case "docx": 
                 break;
        case "pdf":                  

            tab = new Tab();
            tab.setText(choosedName);
            s1=new ScrollPane();
            tab.setContent(s1);
            s1.setContent(PDFView.showPDF(sFiles[i]));
        tpane.getTabs().add(tab);
</code></pre>