This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
1. i am trying to display a .png image, will that work or will only .gif work ? 2. I am using following code ---------------------------------------- String text = "<html>\n" + "<font color=red>hi my name is sarim</font>\n" + "<img src=\"/home/masters/2001/sr1305/tomcat/webapps/ROOT/myadmin/graphs/copy.gif\" width=200 height=200></img>"; editorPane = new JEditorPane(type, text); it shows the font, but shows an empty icon in place of the image.... I have included the full absolute path to the image folder
You'll have to use the add-on JAI (Java Advanced Imaging) API, or the new (JDK 1.4+) ImageIO classes to open and display a PNG image... the pre-1.4 JDKs only supported GIF and JPG images "out of the box".
Ohh... just looked at the #2 part of your question... I'm not sure if the JEditorPaneHTMLEditorKit would be able to support PNG if it was able to find the JAI PNG loaders or not... maybe it will... if not you'll have to write a new HTML editor kit to support PNGs once you are able to load them... [ August 15, 2002: Message edited by: Nathan Pruett ]
Write once, run anywhere, because there's nowhere to hide! - /. A.C.