-
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...
eschew obfuscation
-
 Originally Posted by sjalle
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...
Hi sjalle,
Thanks for the hint on the JPanel solution. I managed to do my fancy table with a day of hard work
Similar Threads
-
Replies: 1
Last Post: 05-07-2003, 06:01 PM
-
By Alice Claussen in forum Web
Replies: 5
Last Post: 10-05-2001, 01:49 PM
-
By John Hillman in forum Mobile
Replies: 1
Last Post: 10-31-2000, 01:35 AM
-
By Mark Taylor in forum Architecture and Design
Replies: 1
Last Post: 10-25-2000, 07:21 PM
-
By Mark Taylor in forum Web
Replies: 0
Last Post: 10-24-2000, 10:08 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks