gluonhq / client-samples

Client samples to run with Gluon Client plugins for Maven and Gradle
114 stars 23 forks source link

FXML and JavaScript examples #74

Closed XakepSDK closed 4 years ago

XakepSDK commented 4 years ago

Is this possible to use JavaScript in FXML? I would appreciate for FXML + JavaScript examples

abhinayagarwal commented 4 years ago

Hi @XakepSDK ,

Please refer to "Introduction to FXML" guide for a better understanding on FXML.

You can use CSS, but JS is not ~supported~ required as the logic can be handled in Java.

XakepSDK commented 4 years ago

Is this GraalVM native-image limitation?

abhinayagarwal commented 4 years ago

FXML has nothing to do with GraalVM. FXML uses XML to create UI views for JavaFX.

If you want to check out a mobile app built on JavaFX, leveraging GraalVM's multi-lanuage stack, please check https://github.com/lazar-mitrovic/GraalREPL

XakepSDK commented 4 years ago

Well, it's probably misunderstanding. We have some heavy JavaFX app, that uses FXML and JavaScript. We want to use GraalVM to make single executable. Parts, that don't use JavaScript, work well, but parts where JavaScript is used, do not work, because it can't find JavaScript engine. And, as far i know, GraalVM supports JS in native-image, if argument --launguage:js present. I tried to compile it with this argument added, but it didn't work.

abhinayagarwal commented 4 years ago

Can you give a short example on how you are leveraging JavaScript in your JavaFX app?