ScrollPane.setScrollPosition

ScrollPane.setScrollPosition

Class Overview | Class Members | This Package | All Packages

Syntax 1
public void setScrollPosition( int x, int y )
Parameters
x
the x position to scroll to
y
the y position to scroll to
Description
Scrolls to the specified position within the child component. A call to this method is only valid if the scroll pane contains a child. Specifying a position outside of the legal scrolling bounds of the child will scroll to the closest legal position. Legal bounds are defined to be the rectangle: x = 0, y = 0, width = (child width - view port width), height = (child height - view port height). This is a convenience method which interfaces with the Adjustable objects which respresent the state of the scrollbars.

Exceptions
IllegalArgumentException if specified coordinates are not within the legal scrolling bounds of the child component.



Syntax 2
public void setScrollPosition( Point p )
Parameters
p
the Point representing the position to scroll to
Description
Scrolls to the specified position within the child component. A call to this method is only valid if the scroll pane contains a child and the specified position is within legal scrolling bounds of the child. Legal bounds are defined to be the rectangle: x = 0, y = 0, width = (child width - view port width), height = (child height - view port height). This is a convenience method which interfaces with the Adjustable objects which respresent the state of the scrollbars.

Exceptions
IllegalArgumentException if specified coordinates are not within the legal scrolling bounds of the child component.