【发布时间】:2012-01-15 16:25:34
【问题描述】:
我有一个 JTextPane 并且我做到了:
HTMLEditorKit kit = new HTMLEditorKit();
HTMLDocument doc = new HTMLDocument();`
this.setEditorKit(kit);
this.setDocument(doc);
然后我做:
profilePictureSrc = "http://ola/profilePicture1.jpg";
chatContent ="<img src=\"" + profilePictureSrc + "\">";
其中 profilePictureSrc 是一个 URL 对象。
它有效,但我必须使用字符串而不是 URL (Java Hashtable put method slow down my application)
我该怎么做?我是否必须将图片文件放在某处并使用相对路径来访问它们?非常感谢您的想法
最好的问候
【问题讨论】:
标签: java html swing image jtextpane