Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTable and wrap text in cell

800563Sep 20 2007 — edited Sep 24 2007
Hi
I have a JTable where one cell can have maximum of 20 lines of text, in my JTable i want to show only maximum of 3 Row, and on on mouse over, show all the 20 lines,
I have defined DefaultTableCellRenderer and in it i set'

setToolTipText(value.toString());
this brings up the tool tip, when the cursor is on that row,

Now i want to show maximum of 3 rows of data, i want this component to be smart enough to show only one row, if there is less data

I looked into this post on forum, but there is a bug, in it, it the row is not selected then you get only one row,

http://forum.java.sun.com/thread.jspa?threadID=664383

Any solution to do so

Ashish


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2007
Added on Sep 20 2007
5 comments
1,229 views