rostegg
rostegg

Reputation: 88

java-JavaFx WebView doesn't work upcall from JS on Debian

I have a WebView on which the button is located. When pressed, the method from the controller should be called.

Controller

public class Controller
 {
   public void out(String a)
   {
    System.out.println(a);
   }
 }

JS

function clickButton() { controller.out("test");}

The code is given in the example. The problem is that in Windows all works fine.But on Debian it works through time. Test with help OracleJDK and OpenJDK.The result is the same. I'm sure that the controllers are connected, as i said, on Windows all works, on Debian through time.

Upvotes: 0

Views: 127

Answers (1)

rostegg
rostegg

Reputation: 88

Solved. The problem was in linux gc. Through reflection, I found controllers and added them. After a while, gc deleted weak links. So, use classfield like

Controller controller = new Controller(); window.setMember ("controller", controller);

Thanks a lot Cannot call JavaFX from WebView JavaScript on Windows (VirtualBox)

Upvotes: 1

Related Questions