• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating java objects from javascript using JavaFX webengine

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic