wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Increase Table/scroll pane size corresponding to split pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Increase Table/scroll pane size corresponding to split pane" Watch "Increase Table/scroll pane size corresponding to split pane" New topic
Author

Increase Table/scroll pane size corresponding to split pane

John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
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
Bartender

Joined: May 31, 2011
Posts: 1776
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?

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

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.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
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
 
jQuery in Action, 2nd edition
 
subject: Increase Table/scroll pane size corresponding to split pane
 
Similar Threads
JTable
Change Table and Tree color when selected (vice versa)
GridBagLayout resize issue
Updating a JTable
JTable