Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JScrollPane smooth scrolling to a new view position.

843806Feb 9 2009 — edited Feb 11 2009
I have a JScrollPane and within it a JPanel.

The JPanel contains many other JPanels which contain various graphics, some of wich are in the viewport vieable area of the JScrollPane and some are outside of the viewport bounds.

I have been successfully using
JScrollPane.getViewport.setViewPosition(new point(x,y))
to scroll the JScrollPane's view port to objects that are not within the bounds of the viewport.

However, instead of jumping directly to the object I need a way that I can smoothly scroll to it.


How do I go about this?


Kind Regards

Scottie.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2009
Added on Feb 9 2009
7 comments
1,381 views