| Author |
Increase Table/scroll pane size corresponding to split pane
|
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
|
|
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: 1778
|
|
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: 949
|
|
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: 1778
|
|
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
|
 |
 |
|
|
subject: Increase Table/scroll pane size corresponding to split pane
|
|
|