• 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 ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Relative Image Path Problem in insertHTML of HTMLEditorKit  RSS feed

Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!