How can jFrames be used inside of JavaFX?

java, javafx, swing, web-applications

Solution

javafx file:

import javax.swing.JComponent;
import javafx.ext.swing.SwingComponent;

class NewFxComponent extends SwingComponent
{ 

    var comp: JComponent;

    public override function createJComponent():JComponent
    {
        return new OldJComponent();
    }

}

Problem

I just saw a article on Swing being used in JavaFX. How can an application that uses a jFrame to display graphics be ported into JavaFX? Also, will the jButtons and jSliders work in the normal manner? I know this is a generic question but I know little of JavaFX and am curious about porting some desktop applications to the web via the JavaFX package.

Original source