cant display gif/jpg in JEdtiorPane ..
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sarim_raza
Posted On:   Thursday, August 15, 2002 10:25 AM

I am using jdk1.4


I get an empty icon in place of the image....
I have included the full absolute path to the image folder

thanks

Re: cant display gif/jpg in JEdtiorPane ..

Posted By:   Mike_Friedrich  
Posted On:   Thursday, August 15, 2002 11:12 PM

For contenttype "text/html": If you don't use the setPage method, you need to set base where JEditorPane look for pages/files. As i remember the image is not displayed even with absolute path.


Try this:


java.net.URL baseUrl = null;
try {
baseUrl = new java.io.File(".").getCanonicalFile().toURL();
HTMLDocument hdoc = (HTMLDocument)yourEditorPane.getDocument();
hdoc.setBase(baseUrl);
} catch ( IOException exc ) {
//log.error(exc);
}


If you don't use HTML here, i can't help without looking at your code.


Regards, Mike

About | Sitemap | Contact