@Paidi-Ramesh said in how to I do excuited function in javascript to java: JAVA code: mapTypeGroup.selectedToggleProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue observableValue, Toggle toggle, Toggle toggle1) { if (cond.isSelected()) { webEngine.executeScript("setRainWindy()"); System.out.println("Im passing command"); } } }); JAVASCRIPT: function setRainWindy(){ /* In this place, I'm only calling rain parameters */ }