• Post Reply Bookmark Topic Watch Topic
  • New Topic

JScrollPane  RSS feed

 
Ranch Hand
Posts: 128
Eclipse IDE MS IE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
scrollpane.getVerticalScrollBar().setValue(0);
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!