List of usage examples for javafx.scene.web WebEvent toString
@Override
public String toString()
From source file:org.openbase.display.WebTab.java
private static WebView newWebView() { logger.info("init new WebView..."); WebView webView = new WebView(); WebEngine webEngine = webView.getEngine(); webEngine.setJavaScriptEnabled(true); webEngine.setOnAlert((WebEvent<String> event) -> { ExceptionPrinter.printHistory(new InvalidStateException("Webengine alert detected!", new CouldNotPerformException(event.toString())), logger); });/*from w ww .j av a 2 s .c om*/ webEngine.setOnError((WebErrorEvent event) -> { ExceptionPrinter.printHistory(new InvalidStateException("Webengine error detected!", new CouldNotPerformException(event.toString())), logger); }); webEngine.getLoadWorker().stateProperty().addListener((ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newState) -> { Throwable exception = webEngine.getLoadWorker().getException(); if (exception != null && newState == Worker.State.FAILED) { ExceptionPrinter.printHistory(new InvalidStateException("Webengine exception detected!", exception), logger); } }); CookieManager.getDefault(); return webView; }