Is there a widget for Swing that behaves like a JLabel
, that automatically reflows the text if its dimensions have changed? For example:
Large horizontal space available: +--------------+ | Foo bar baz | +--------------+ Small horizontal space available: +---------+ | Foo bar | | baz | +---------+
I am currently using JEditorPane
with setContentType("text/html")
and HTML content. This works, but it does not use the System's default label font for displaying the text. Also, I would rather not put HTML tags into my text - at best, \n
characters would be transformed into line breaks and everything else would be displayed as text.