java-electron-tutorial icon indicating copy to clipboard operation
java-electron-tutorial copied to clipboard

Vaadin 10

Open gpallas16 opened this issue 6 years ago • 6 comments

Hi. I like this technique and I am trying to implement it in my project but it seems Vaadin 10 doesn't work like that. Any tips or quick fix on how to do this with Vaadin 10?

gpallas16 avatar Oct 04 '18 20:10 gpallas16

Conceptually, all the stuff should work for Vaadin 10, the only difference is the way you start Jetty (servlets and setup changed in V 10). I did not try this with V 10, so cannot say what is wrong with it.

jreznot avatar Oct 05 '18 03:10 jreznot

Well after a lot of tries I have not managed to make it work. So I followed your tutorial here and your example app. Everything is working perfectly but I have (hopefully) one last question. I am currently executing java methods in javascript and vice versa but in some cases I want to pass arguments in the methods ie mainWindow.webContents.executeJavaScript("addText("+ jsonArray +");"); is something like that possible? Thank you for your time :)

gpallas16 avatar Oct 05 '18 05:10 gpallas16

Sure, its possible, see examples here https://github.com/jreznot/electron-java-app

jreznot avatar Oct 05 '18 05:10 jreznot

FWIW, I have gotten it to run with Vaadin 10. What I did was use the Spring Boot Starter project from Vaadin, so I didn't have to worry about Jetty et. al. For the Electron part it really does not matter what you use, you can always write a startup.sh or startup.bat script to custom-launch your application and then launch that script from main.js.

realulim avatar Nov 05 '18 23:11 realulim

@jreznot Now that Vaadin 14 (the next LTS) is out, maybe it makes the most sense to update to that instead of 10 or 12?

Octogonapus avatar Sep 17 '19 00:09 Octogonapus

Yes, I've been waiting for 14 LTS release because there they finally support NPM packages for front-end. See https://github.com/jreznot/electron-java-app/issues/15

jreznot avatar Sep 17 '19 06:09 jreznot