Skip to content

Instantly share code, notes, and snippets.

@micheljung
Created December 1, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micheljung/ff146e904ef02b89d14f to your computer and use it in GitHub Desktop.
Save micheljung/ff146e904ef02b89d14f to your computer and use it in GitHub Desktop.
Reproduces JDK-8144162 Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at com.sun.javafx.webkit.theme.ScrollBarThemeImpl.getThumb(ScrollBarThemeImpl.java:409)
package sample;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.concurrent.Worker;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class JDK8144162 extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
WebEngine engine = new WebView().getEngine();
engine.getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) -> {
if (Worker.State.SUCCEEDED.equals(newValue)) {
Platform.runLater(() -> engine.executeScript("window.scrollTo(0, document.documentElement.scrollHeight);"));
}
});
engine.load("http://www.google.com");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment