Here you can find the source of isScrolledToBottom(final JScrollPane scrollPane)
public static boolean isScrolledToBottom(final JScrollPane scrollPane)
//package com.java2s; import javax.swing.BoundedRangeModel; import javax.swing.JScrollPane; public class Main { /**// w ww . j av a 2 s. c o m * Checks whether the given {@link JScrollPane} is currently scrolled to the * bottom of its view. */ public static boolean isScrolledToBottom(final JScrollPane scrollPane) { final BoundedRangeModel m = scrollPane.getVerticalScrollBar().getModel(); return m.getValue() + m.getExtent() >= m.getMaximum(); } }