This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Positioning to bottom of a JList in a JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Positioning to bottom of a JList in a JScrollPane" Watch "Positioning to bottom of a JList in a JScrollPane" New topic
Author

Positioning to bottom of a JList in a JScrollPane

Robert Upshall
Greenhorn

Joined: Aug 23, 2001
Posts: 25
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

Joined: Oct 18, 2000
Posts: 4121

You do this through the list itself...



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Positioning to bottom of a JList in a JScrollPane