B4J Question Override Url in Webview


Active Member
Licensed User
Hi everyone and @Erel can you please check this link: https://www.codota.com/code/java/methods/javafx.scene.web.WebEngine/locationProperty

I saw this code

How to deny access to webpage from javafx web:
WebEngine engine = webview.getEngine();
engine.locationProperty().addListener((observable, oldValue, newValue) -> {
  if (newValue.contains("badsite")) { // replace with your URL checking logic
    Platform.runLater(() -> {
      // Load your block page url

but I don't know how to make it work for B4J
Upvote 0