• 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=> scrollpane problem

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
My GUI comprises of the following :
JAPplet => Bean =>( JScrollPane => JTable and some buttons)
I'm loading the table with some data . It has 4 columns and n rows with the rows increasing by the data loaded. I've made the last 2 columns hidden. Now, when I'm trying to add the data, my JTable is growing in size without the scrollpane appearing . This is covering up the buttons inside the bean since the JTable's size is >sing. Could somebody suggest me with a solution.I'd really appreciate a faster response.
Thanks
sandhya
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here you go mate this method should sort it out as i had the same problem.
setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
then set the scrollbar to appear always.
rob.
 
Sandhya Rprasad
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Rob, Thanks for the response but the scrollpane becomes very small and still does'nt make the scrollbar appear. Okay, the problem is the last 2 columns are hidden(there are 4 columns).
So, what's happening is when I make the size of the bean small, instead of the vertical scrollbar appearing, a horizontal scrollbar sort appears on the vertical side of the scrollpane. Also the table is covering up the rest components of the bean. I guess this is a little weird to explain, but I've tried to be clear .. I hope. So, if you come up with some ideas, do let me know.
Thanks
Sandhya
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Add the JTable to a JPanel and then add the JPanel to the JScrollPane. This helped me when I had this trouble.
Hope this helps.
David
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic