• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable with a multiple rows in a singel cell

 
Suman Mummaneni
Ranch Hand
Posts: 96
Android Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Is it possible to create a JTable with multiple rows in a single cell or is it possible to do a kind of text wraping in a the cell of a JTable. I need some sample code that does that.

-Suman
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to have a look at the tutorial from Sun on their website about JTables. In there you will find information about DefaultCellRenderer. What you are going to have to do it change the renderer to return a JTextArea component for that cell.

Have a look at the tutorial and then post some code and we'll help you out.

Cheers,
Rachel
 
Suman Mummaneni
Ranch Hand
Posts: 96
Android Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rachel Swailes ,

I have read the tutorial from sun. He is my program but its not doing what its suppose to do.


I do not understand why my code is not work proprely its displaying the table but the row height is not changing and the text area is also not being inserted into the cell. If you have got a better Idea than this plz reply

-Suman
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!