*
The moose likes Swing / AWT / SWT and the fly likes How to work with a ScrollPane in a SplitPane? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to work with a ScrollPane in a SplitPane?" Watch "How to work with a ScrollPane in a SplitPane?" New topic
Author

How to work with a ScrollPane in a SplitPane?

Josh Rehman
Ranch Hand

Joined: Jul 24, 2001
Posts: 63
I'm trying to place a ScrollPane in a SplitPane such that if you make the split pane smaller than a panel, the scroll pane will allow you to scroll around.
The Scroll function works when it is directly in a frame that has been resized. And yet the split pane either a) won't allow itself to be resized or b) won't seem to trigger the scrolling functionality.
Here is some sample code I wrote:
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

You are adding your panel to the left side of the splitpane:
split.setLeftComponent(panel);
You should be adding the ScrollPane
split.setLeftComponent(scroller);
That makes it work.
[ September 20, 2002: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Josh Rehman
Ranch Hand

Joined: Jul 24, 2001
Posts: 63
How embarrasing! Thanks.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Don't be embarrased. We've all done more embarrasing things.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to work with a ScrollPane in a SplitPane?
 
Similar Threads
JFrame won't repaint...
Haw to separate a frame to diferent fraims
view before and after Tsunami
Increase Table/scroll pane size corresponding to split pane
Problem with JTree inside JScrollPane inside JPanel