• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to work with a ScrollPane in a SplitPane?

 
Josh Rehman
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Josh Rehman
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How embarrasing! Thanks.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't be embarrased. We've all done more embarrasing things.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic