This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JScrollPane" Watch "JScrollPane" New topic
Author

JScrollPane

Allen Bandela
Ranch Hand

Joined: Feb 16, 2006
Posts: 128

Hi,
I have a JScrollPane that contains a JList component. The scroll pane has default vertical and horizontal scrollbar's.

I'm using the above two components to display results of a search. Considering the following scenario,
a)I click the search button once
b)scroll down to see the results
c)press the search button again

The scroll bar still remains at the previous scrolled position.
Can anyone suggest ways I can make the scroll bar scroll up during every time the scroll pane displays a new set of results? Thanks in advance.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
scrollpane.getVerticalScrollBar().setValue(0);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JScrollPane
 
Similar Threads
Scrolling a JPanel
Mirroring JScrollBars
Hide a Vertical ScrollBar of JScrollPane[very...... Urgent....}
Scroll around main JFrame?
How to Add Scroll bars to a frame