ScrollPane.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
/**
 * Returns the current x,y position within the child which is displayed
 * at the 0,0 location of the scrolled panel's view port.
 * This is a convenience method which interfaces with the adjustable
 * objects which represent the state of the scrollbars.
 * @return the coordinate position for the current scroll position
 * @throws NullPointerException if the scrollpane does not contain
 *     a child
 */
@Transient
public Point getScrollPosition() {
    synchronized (getTreeLock()) {
        if (getComponentCount()==0) {
            throw new NullPointerException("child is null");
        }
        return new Point(hAdjustable.getValue(), vAdjustable.getValue());
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号