JTable + multiline cell + align problem
Hi all,
Does anyone know how I could make a java table that has multiline text cells AND this multiline text is aligned to center? I tried to extend JTextArea and to implement TableRenderer - multiline was OK but it did not do anything on setHorizontalAlign. If I extend DefaultTableRender than I can align the text to center but I got no multiline...
Any ideas?
Thanks in advance.
Somi
A far fetched one perhaps...
Have you tried using a JPanel extension where you override the paintComponent method and do the text drawing yourself, with FontMetrics for aligning the text strings properly in the xy plane.
When a component class is used as a renderer, then most of the other functionality of that component class is unavailable. I tried it some years ago, and I was unable to fill a table column with "well behaved" scrollable textareas. That may have improved though...