@dinitha-ransidhu if you want to build a cross-platform application I think it is best with c++(with QT Framework) more than JFX. You can write the UI objects in code or use QML which is a declarative language somewhat similar to JSON by using QT Framework with C++. JavaFX is newer and it is as a replacement for Swing, but it has relatively low adoption.
For .net core - Check This