This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Positioning to bottom of a JList in a JScrollPane

 
Robert Upshall
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JList that is in a JScrollPane. It is possible for the list to be larger than the viewport. What I want to do is always position the scrollbar to the bottom of the list, the default is the top of the list. How do I set the scrollbar positon in a ScrollPane.
I have atempted
myScrollpane.getVerticalScrollBar().setValue(listSize);
but this doesn't appear to be working, is this the proper way? If not what would it be?
Robert
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do this through the list itself...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic