• Post Reply Bookmark Topic Watch Topic
  • New Topic

JEditorPane HTML and <img> width  RSS feed

Jonathan Thorough
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I am having some issues rendering of images in JEditorPane via html content. The image gets rendered just fine, but the problem is that it doesn't respond to css sizing or constraints. The file that is referenced by the "src" attribute is quite large and seems to expand outside the via range of the JEditorPane. I have tried resizing the editorpane itself (both before and after setting the html via setText()), but that only makes the image appear cut off and all the other content is still distorted to fit the sizing of this large image.

I was wondering if anyone had any experience with html rendering in JEditorPanes and knows how I can go about fitting the image to a specified width or even better how to fit it to a locally set size of the editorpane. Things that may be of note is that in this situation I cannot modify the image being rendered, but I have full access to modify the HTML content.

Thanks in advance for the help!
- Thorlax
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!