• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem using JTable

 
Paras Ahuja
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I have made the cells of a jtable non-editable. But now when the text in a column exceeds the column's width, its not completely viewable.
Any solution??
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try to write a Renderer that extends TextArea (and remember to set line wrap as true).
And then, I think you also need to increase the row height for this to work.
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope you mean JTextArea. You shouldn't mix AWT and Swing components, and you should especially not use AWT components for any renderer (table, list or tree).
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I meant JTextArea only...
sorry about the misleading info (I think by default in Swing only...but, obviously I can't assume the same for others...my bad)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic