• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

JTAble = Jscrollpane 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

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try to resizet the JScrollpane according to the change in the rows of the table
first draw the JScrolpane then table on it dynamicaly changing the value of table not the scrolpane's entir area.
 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try calling applet.getContentPane().validate() every time the size of the table changes.
Or try pack(); show(), every time the table changes.
Let us know how you solved the problem.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this link:
http://www.javaranch.com/ubb/Forum2/HTML/000909.html

David
 
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
Okay people, I found the flaw with the scrollpane. I did'nt have to specify the scrollbar policy which I had forced in the Init() method of the bean which was why my scrollbars were appearing weird on the screen. Other than this correction, nothing else was required.
Sandhya
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic