Monday, March 23, 2009

How do I determine the location a component in a JScrollPane is currently scrolled to?

The JViewport of the JScrollPane provides a method to return the location of top left point showing in the scroll pane.

JViewport viewport = myScrollPane.getViewport();
Point scrolledTo = viewport.getViewPosition();

No comments: