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

JTable Help

Hasnain Javed
Greenhorn

Joined: Aug 07, 2005
Posts: 16
Hello,
I have some problems to be solved with JTable
1) The column names do not appear completely
2) I have a field called Remarks and consists of atmost 255 words. I can only see a few words.
3) One of the tables has alot of fields which means a big table and the big table will not be shown completely ( as the frame will be smaller then the size of the table in width ). will a horizontal scroll bar do ???
An early response will be highly appreciated.
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
1) Not sure, normally I write my own TableModel.

2) Get the TableColumnModel and then the individual TableColumn. Then use the setPreferredWidth, setMinWidth, and setMaxWidth methods to adjust the column width:


3) Adding your table to a JScrollPane should do it.
Hasnain Javed
Greenhorn

Joined: Aug 07, 2005
Posts: 16
Sorry Sir, I still have the same problem. I still see a few words and no horizontal scroll bar is added ?? what should I do?
[ August 13, 2005: Message edited by: Hasnain Javed ]
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Did you change the width of the columns? By default JScrollPanes only show the scrollbars when their contents is bigger than the display area. Trying making the columns very wide and it should stretch the table enough to invoke the scrollbars.
 
Consider Paul's rocket mass heater.
 
subject: JTable Help
 
Similar Threads
JTable(!!!)
JTABLE
jtable
jtable
JTable