I want my JLabel
to be the height required for the particular string that is assigned to the text. The text string can can have any number of lines, which use the \n
in the string. So if you have a string the "Hello\nit\nis\nme\n"
the height of the label will automatically be adjusted to fit the 4 lines.
How to achieve that?