Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Table cell width  RSS feed

 
Snehal Paatil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I want to display long text mayb around 200 and above characters .. I have set the width but i want wrapped text..i should be able to see it in one view , not by scrolling explicitely..How can i do that ?any auto proprty or something?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Snehal,

Welcome to the Ranch.

Have you considered a custom renderer for your required column which would render the text inside a JTextArea?
 
Snehal Paatil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Hi Snehal,

Welcome to the Ranch.

Have you considered a custom renderer for your required column which would render the text inside a JTextArea?



hello

i have written this custom renderer

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code renders the table header as a check box.
Your original post was about displaying long text in a table cell.

How are these two related? Did you copy the wrong code by mistake?
 
Snehal Paatil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Your code renders the table header as a check box.
Your original post was about displaying long text in a table cell.

How are these two related? Did you copy the wrong code by mistake?


ohh yes yes...
I havent done any custom renderer for text yet..how do i do that?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

Check out the section which talks about editors and renderers
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!