Created
December 1, 2015 14:39
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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