Can't display image in JEditorPane + HTML
Hello.
Isn't possible to display an image in JEditorPane setting the following HTML?
A .html page in a browser works fine but in JEditorPane not!
Do you know the reason? Thanks in advance.
Where's the Image?
src attribute is supposed to contain url not a file path. If your url is pointing to a local filesystem, you have to say so. Try
[code]

[/code]
Thanks rah003... but it doesn't work. The very strange thing is that the same HTML code, as a separate .html file, works in a browser!
So I am supposing the JEditorPane accepts HTML code but the image contents.
Any Help?
Thank you.
> Any Help?
Yeah, don't use bitmaps, but jpg, gif or png as an image. While IE can render bmp, it is not mandatory for browser/html parser to be able to show those.
Hi, I am trying to display and html page that contains a png image in JEditorPane and I don't get the image. This is waht I am doing:
java.net.URL helpURL = ClassLoader.getSystemResource("ChartReport.html");
myEditorPane.setPage(helpURL);
******ChartReport.html********
<body class="style_0" style=" margin:0px;">
<table cellpadding="0" rule="none" style="empty-cells: show; width:8in; overflow: hidden; table-layout:fixed;">
<col></col>
<tr>
<td></td>
</tr>
<tr>
<td valign="top">
<div>
<img src="images/previewCA91LA3F.png" alt="" />
</div>
</td>
</tr>
<tr>
<td>
<div>Jul 8, 2011 10:16 AM</div>
</td>
</tr>
</table>
</body>
Thanks in advanced
Very good! It runs.
Thank you very much.




just to read better the code, substitute '#' with '<'
#html> #head> #/head> #body> #table border='1' width='100%'>
#tr> #td>
where is the Image?
#tr>
#td> img src="c:\sad.bmp">
#/td>
#/tr>
#/table> #/body> #/html>