• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Increase Table/scroll pane size corresponding to split pane  RSS feed

 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When i drag the divider from left to right, the left component is not increasing in its size and occupying the split pane. How to make it the component (jtable & scrollpane) to drag itself and go to the entire size of split pane.

sample code -
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After adding a component listener for scroll pane i was able to make the change. Actually scroll pane was increasing its size when the split pane increases, it was the table that did not increase its size automatically.

I have one question - why the propertylistener that listens for divider change prints 5 times when i move the divider once?

 
Bartender
Posts: 1104
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The scrollpane and component do occupy the entire left area when you drag the splitpane. However, as the column size the table is smaller, it gives you a illusion that it doesn't occupy the space. Do the following:
1) Drag the divider.
2) Then resize the column i.e increase the column size by dragging the header. You would see the horizontal scroll bar appear - which will show you that the scrollpane does occupy the entire space.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the column width was the one needed to be increased. But i took some time to figure out how to increase it - finally i have to set the min width, max width and then preferred width to actually increase the column width
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!