• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Relative Image Path Problem in insertHTML of HTMLEditorKit  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am using insertHTML method of HTMLEditorKit for inserting html text inside texteditorpane . In HTMLDocument of texteditor pane I want to display images too . For images I am using relative part of the respective image in src attribute of <img. But its not finding the path of the image & hence its not loaded.

I am doing

insertHTML("hi der dude<img src='./emoticons/images/smile.gif' alt=' ' >");



On top of that if I use classloader.getresource(imagepath) , the url I get works .
But it doesnt fit in my requirement ,THATS THE BIG CONSTRAINT.

I have gone through the setBase to set the base URL of document but couldnt get on top of that to get the pbm solved.

Please suggest some solution.
thanks
Ani
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!