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?
just to read better the code, substitute '#' with '<'
#html> #head> #/head> #body> #table border='1' width='100%'>
where is the Image?
#td> img src="c:\sad.bmp">
#/table> #/body> #/html>
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
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?
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");
<body class="style_0" style=" margin:0px;">
<table cellpadding="0" rule="none" style="empty-cells: show; width:8in; overflow: hidden; table-layout:fixed;">
<img src="images/previewCA91LA3F.png" alt="" />
<div>Jul 8, 2011 10:16 AM</div>
Thanks in advanced
Very good! It runs.
Thank you very much.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.