Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating java objects from javascript using JavaFX webengine

 
Rafi Abdullah
Greenhorn
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: http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm#CEGHJJCA

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 http://docs.oracle.com/javafx/2/deployment/javafx_javascript.htm#BCEEJBGC. 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?

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic