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
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
 
Similar Threads
help me.. problem with using android app, jquerymobile and html
Migration from Windows C based GUI to JavaFX
How can I include a JavaFX 2.0 application into a HTML page?
JavaFX vs OpenGL(JOGL)? Java SE vs Java EE vs JavaFX?
Getting data from database using ajax