JTable - Wrapping text in a cell.
843804Jun 15 2005 — edited May 16 2008Hello,
Can anyone tell me how to dynamically wrap the text in a particular cell of a JTable if it is to long to be displayed on one line? I don't care if it affects the row height, in fact I would like the row height to be automatically adjusted to fit the text.
Basically, I have a table with 3 columns, the third of which is a "notes" column and allows up to 500 characters to be displayed. When the text is too long the table truncates it with an elipsis (...) and the user can't see the rest. I would like the text to wrap within the cell (changing the row height) so that the user can read the entire note more easily. In addition, and I realize this may add a significant wrinkle, my client does not want to see a scrollbar just the whole note.
Has anybody been able to do this?
Thank you,
G Poole