Java JScrollPane isScrolledToBottom(final JScrollPane scrollPane)

Here you can find the source of isScrolledToBottom(final JScrollPane scrollPane)

Description

Checks whether the given JScrollPane is currently scrolled to the bottom of its view.

License

Open Source License

Declaration

public static boolean isScrolledToBottom(final JScrollPane scrollPane) 

Method Source Code

//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();
    }
}

Related

  1. getScrollBarWidth(BasicComboPopup popup, JScrollPane scrollPane)
  2. getScrollPaneViewportSize(JScrollPane panel)
  3. hasParentScrollPane(JComponent component)
  4. initScrollPane(JScrollPane scrollPane)
  5. isHorizontalScrollBarHiddenAlways(JScrollPane pane)
  6. makeComponentDragScrollable(final JComponent component)
  7. makeListInScrollPane(Collection items, Function namer)
  8. makeVScroller(Component c)
  9. moveEnd(JScrollPane pane)