1

I want to access javascript variables from JavaFX to control longitude and latitude variables which are in googlemaps.html. x(long.) and y(lati.) variables will be defined as double and I will assign them some values inside JavaFX and these values will assign values to 2 variables ,named x2 and y2, inside Javascript.and then,a marker will be shown on googlemaps based on x2 and y2.
Why I want to control the values from JavaFX is x and y variables will be assinged from a text file.so I need to control them from Javafx...

1 Answer 1

2

You can execute javascript using WebEngine.executeScript() which will assing listeners to specified variables.

Those listeners can call JavaFX code, see Calling back to Java from JavaScript section of http://docs.oracle.com/javafx/2/api/javafx/scene/web/WebEngine.html for examples.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.