Determining if a text field is displaying all it's text
Hi,
I have a text field with some text in it that is too long for the text field to display. I was wondering if there was a way of determining if the text is too long for the display field without having to go into getting the size, font, and calculating from font metrics?
thanks,
J
# 3
> Try comparing the number of characters in the string against the number of display columns for the textfield.
Will only work when using a monospaced font. When using a proportional font multiple "i"s will take up less space than multiple "w"s.
> (its in a JTable)...
Compare the preferred size of the renderer with the width of the TableColumn.