Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java wrap text around image

How to wrap text around an image in Java? Or how to accomplish CSS float in Java?

I am loading a HTML text with some image tags into JTextPane component.

Example:

text text text text <img src="image.ext"> text text text

Example2: http://www.bbc.co.uk/news/world-us-canada-11882019 (text left, image right something similar)

And i need the image to be wrapped with a text.

Tried using css... float: right; (Java doesn't support that feature.. need it..)

Tried all image alignments(left, right etc.) (no luck..)

P.S. PHP programmer..

like image 984
Brudas Avatar asked Jun 15 '26 14:06

Brudas


1 Answers

The Swing tutorial on Using Text Components, shows how to use a JEditorPane to display HTML with an image.

like image 62
camickr Avatar answered Jun 18 '26 03:06

camickr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!