import javafx.application.Application; 
import javafx.application.Platform; 
import javafx.scene.Scene; 
import javafx.scene.web.WebView; 
import javafx.stage.Stage; 

public class Main2 extends Application { 

    public static void main(String[] args) {
        Application.launch(args); 
    } 

    @Override 
    public void start(Stage primaryStage) { 
        try { 
            WebView webView = new WebView(); 

            Scene scene = new Scene(webView, 800, 600); 
            primaryStage.setScene(scene); 
            primaryStage.show(); 

            String crashHtml = "<blockquote class=\"twitter-tweet\"><a href=\"https://twitter.com/stu_bot3000/status/793389598227529728?ref_src=twsrc%5Etfw\"></a></blockquote>\n" + 
                    "<script src=\"https://platform.twitter.com/widgets.js\"></script>"; 

            webView.getEngine().loadContent(crashHtml); 

            new Thread(() -> { 
                try { 
                    System.out.println("Wait 5 sec to full load, then set this content again..."); 
                    Thread.sleep(5000); 
                    Platform.runLater(() -> { 
                        System.out.println("Reloading... and crash..."); 
                        webView.getEngine().reload(); 
                    }); 
                } catch (Exception e) { 
                } 
            }).start();


        } catch (Exception e) { 
            e.printStackTrace(); 
        } 
    } 
} 