• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Column

 
Garandi Garandi
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the header of a column in a JTable is too long I want it to wrap around and be visible in two lines.
How to achieve the above goal?
Thank you
Garandi
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try putting \n in your header String.
 
Garandi Garandi
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did but it does NOT work.
Garandi
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post your code. I have code where I put it in the column header and it works fine.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a link to a JTable example with Multiline headers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!