I'd like to know if there is a way to know when a JScrollBar
(vertical in my case) has reached the bottom of his containing JScrollPane
.
At first i have though of using an AdjustmentListener
on the scroll bar but i don't know how to interpret the value
attribute of the JScrollBar
. Also i'm not sure to properly understand what the maximum
represents and if i can use with the value to get the information i need.
Edit:
scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
@Override
public void adjustmentValueChanged(AdjustmentEvent ae) {
System.out.println("Value: " + scrollPane.getVerticalScrollBar().getValue() + " Max: " + scrollPane.getVerticalScrollBar().getMaximum());
}
}