954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

JScrollPane Auto Scrolling Not Working!!!

Ok, Here is the thing.
I have a JPanel inside the JScrollPane. JPanel has many Images (as ImageIcons on JLabel). Now I want to make the auto scrolling to be happen when I place mouse over the JScrollPane or any child of its.

I could do the scrolling to the end of JPanel by calling this

for (int i = 1; i < jPanel1.getHeight(); i++)
jPanel1.scrollRectToVisible(new Rectangle(0, i, 1, 1));

under mouseEntered event of JScrollPane.
But this is not what I want.

I want it to happen smoothly and I also want the Scroll Bar to move according to the viewport. Like a animation. When I get the mouse pointer back, I want it to freeze where the JPanel is nw....

How can I do this?

dirnthelord
Newbie Poster
18 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: