• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTAble = Jscrollpane problem

 
Sandhya Rprasad
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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

 
maateen ashraf
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • 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.
 
Rahul Rathore
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • 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.
 
David Freels
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!