Height of a JLabel
843804Nov 19 2004 — edited Nov 19 2004Hi,
I have a JLabel that shows a little html text. I put it into a column, and it wraps its lines using word wrapping (This is good). Now once its wrapped its lines, I want to find its height.
getPreferredSize gives you the height of an unwrapped JLabel... I tried another approach, and that was dividing the preferred height by the column width. This is not accurate, due to long words near a line break.
How do I find the height of a line-wrapped JLabel?