1

我正在尝试从 Internet 下载图像以显示在插件中。该插件使用 JEditorPane 并包含 html 内容。我尝试使用可以在常规 HTML 中工作的简单 HTML 代码:

imageUrl = "http://cactus.nci.nih.gov/chemical/structure/" + smiles + "/image";
builder.append("<img src=" + imageUrl + "alt=\"molecule image\"/></p>");

当然,我发现这行不通。我得到的只是图像应该在的地方。我在互联网上查看并发现 HTMLFactory ImageView 可能工作,但我找不到如何实现它。

如果有人可以提供帮助,那就太好了:)

注意:builder 是一个 stringbuilder,我在其中存储 jeditorpane 的 html 内容。

4

1 回答 1

2

http://java-sl.com/tip_local_images.html这可能会有所帮助

于 2012-08-07T13:42:09.470 回答