java Swing Table with wrapped rows

Posted on 2008-11-19
Medium Priority
Last Modified: 2013-11-23
I have a JTable with a couple of columns. What do I need to do to make it wrap the text if the columns isze is too short?
Question by:mdoland
  • 3
LVL 86

Expert Comment

ID: 22998916
You need to use a component for the CellRenderer that supports wrapping, such as JTextPane, instead of the default renderer

LVL 86

Accepted Solution

CEHJ earned 2000 total points
ID: 22999150
Make the change below with the code at this link

        public CustomRenderer() {
                textArea = new JTextArea();
                scrollPane = new JScrollPane(textArea);

Open in new window

LVL 86

Expert Comment

ID: 23039990

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question