Advertisement

JavaScript的htmlEdit如何实现图片拖拽与粘贴功能?

阅读量:

本文件为个人博客系统文档的备份版本,创作者为小游,相关博客链接:点击访问

关键代码如下

复制代码
     /** * 显示html内容
     */
    public void showHtml() {
        WebEngine webEngine = htmlContent.getEngine();
        webEngine.loadContent("<h1>题目</h1><img style='width:100px;height:50px;' src='https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png' />");
    }
    
    /** * 编辑html文件
     */
    public void editHtml() {
        Stage stage = new Stage();
        final HTMLEditor htmlEditor = new HTMLEditor();
        stage.setScene(new Scene(htmlEditor));
        stage.setTitle("文档编辑器");
        sta

全部评论 (0)

还没有任何评论哟~