• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable Help

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 410
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic