Background Image in JTextPane
Posted
by Nivas
on Stack Overflow
See other posts from Stack Overflow
or by Nivas
Published on 2010-03-31T06:29:25Z
Indexed on
2010/03/31
6:33 UTC
Read the original article
Hit count: 587
How do I set a background image to a JTextPane - some sort of a watermark.
I tried this option - creating a child class of JTextPane and use the paint method to draw the image. But then the text is displayed "below" the image than above.
Is there any "standard" or "well known" way to do this?
(BTW, I tried (something silly?) making the content type "text/html", and setting the image as the background image of a <div>
but it did not help.)
© Stack Overflow or respective owner