Forums Register Login

JEditorPane HTML and <img> width

+Pie Number of slices to send: Send
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
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1034 times.
Similar Threads
Panel sizing problem
cant display gif/jpeg in JEditorPane ?
Fitting HTML page within JEditorPane
How to make JEditorPane scrollable?
how to include image in JEditorPane ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:13:18.