Re: Truncated Label Problem



Andrew Thompson wrote

> > Here is the modified code:
>
> ..with a single line change..
> [...]
> setSize( getPreferredSize() );

Im not really sure why you would want that extra line in there. The demo
code was made to illustrate two ways one could deal with HTML-formatting
of long texts, either revalidating without pack (making the label grow
vertically inside the dialog), or revalidating with pack which makes the
dialog grow until label hits max width (and then grow label internally
if even longer).

Inserting setSize(getPreferredSize()) in the demo code has as far as I
can see no positive effect except making pack() being called every time
the button is clicked (and not only when you shift-click like before).


Regards,
--
Filip Larsen


.