Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating java objects from javascript using JavaFX webengine  RSS feed

Rafi Abdullah
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I would like to run an HTML page using JavaFX webview and from the HTML page I'd like to use JS code to create Java object and invoke any method in Java space. I know it is possible to invoke java method by putting Java object into the window object as mentioned here:

But that's not exactly what I need. I need to be able to run following from javascript
var a = new java.lang.String("Hello");
var person = new com.example.Person("Alejandro", 30);
new com.example.SomeManager.welcome(person, a);

This is a bit similar to this But the difference is I am not going to show the app in web browser. I am not using the ant scripts either. So, basically this is plain Desktop application. And creating Java object from JS is not working. Is it because liveConnnect is not used while running as standard desktop app? Or, am I missing something?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!