I can successfully wrap normal HTML text in a JLabel
. But when I use pre
it doesn't seem to wrap.
Here's what I have set the text in my JLabel
to:
<html><pre face=\"Arial\" style = \"white-space:pre-wrap;\">" + temp + "</pre></html>
this same html code works when I test it on w3school's tryit editor (https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_textarea_wrap)
Please provide the simplest solution possible.