Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can you do JScrollPane content NORTH?

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have a scollpanel which contains dynamic content, but I can not find a way to fix the content to the top of the panel, the content alwats starts in the middle.

The panel is set to "vertical-scrollable" so as the content grows the display is fine as it seems to be pushed up the panel and the scrollbar allows the user to view the full content, but if there is only a few lines to the content then it appears slap-bang in the middle! I have looked but the ScollPanelayout manager does not seem to have any 'NORTH' type of flag.

Any ideas?
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like your scroll pane is not being laid out properly. You should look at the layout manager for the container into which you've placed the scroll pane. Some layout manager make it easy to direct that you want a component to take up available space (vertically, horizontally or both). GridBagLayout, for example does this.

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll have a looking into the layout manager.... to be continued (no doubt)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic