aspose file tools*
The moose likes JavaFX and the fly likes Creating java objects from javascript using JavaFX webengine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Creating java objects from javascript using JavaFX webengine" Watch "Creating java objects from javascript using JavaFX webengine" New topic
Author

Creating java objects from javascript using JavaFX webengine

Rafi Abdullah
Greenhorn

Joined: Jan 03, 2013
Posts: 1
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating java objects from javascript using JavaFX webengine