*
The moose likes Swing / AWT / SWT and the fly likes Problem using JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem using JTable" Watch "Problem using JTable" New topic
Author

Problem using JTable

Paras Ahuja
Ranch Hand

Joined: May 22, 2012
Posts: 62
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

Joined: Oct 16, 2003
Posts: 1076
    
  10

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.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

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).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using JTable
 
Similar Threads
jtable
Jtable
JTable
JTable