You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by V SANTOSH PAVAN RAJU Bs <pa...@gmail.com> on 2012/10/08 12:43:11 UTC

Adding listener to scrollpane

Hi,
In my application i want a button to move in vertical direction along with
scrollpane in a dialog.
Here i took the help of MouseWheelListener and wrote the code as following:

scrollPane.getComponentMouseWheelListeners().add(new
ComponentMouseWheelListener() {
@Override
public boolean mouseWheel(Component arg0, ScrollType arg1, int arg2,
int arg3, int arg4, int arg5) {
//statements...
                                                return false;
}
});
When i move my mouse up and down statements are getting executed inside
mouseWheel method but i wasn't able to get the scrollpane postion in
dialog. i tried to use scrollPane.getX(),  .getY().
These two methods always returning value 1. So help me how can i get the
ScrollPane postion vertically.

-- 
Thanks & Regards
B.S.V.S.Pavan Raju.
Skype: skype_pavan1
Hyderabad.

Re: Adding listener to scrollpane

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
try to get the current value using the public method

getScrollTop()

from its superclass (Viewport).

Bye