import com.sun.javafx.webkit.WebConsoleListener; 
import javafx.application.*; 
import javafx.scene.*; 
import javafx.scene.web.*; 
import javafx.stage.*; 

public class WebViewBug extends Application 
{ 
    public static void main(String[] args) 
    { 
		WebConsoleListener.setDefaultListener((view, message, ln, id) -> System.out.println("Log: [" + id + ":" + ln + "] " + message)); 
        Application.launch(args); 
    } 

    @Override 
    public void start(Stage stage) throws Exception 
    { 
        WebView browser = new WebView(); 
        WebEngine webEngine = browser.getEngine(); 
        webEngine.setJavaScriptEnabled(true); 
        Platform.runLater(() -> webEngine.load(ClassLoader.getSystemClassLoader().getResource("bug.html").toString())); 
        stage.setScene(new Scene(browser)); 
        stage.show(); 
    } 
} 
