File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Increase Table/scroll pane size corresponding to split pane