aspose file tools
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


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Positioning to bottom of a JList in a JScrollPane