I added the following code segment to my project to force the JScrollPane automatically be down to the bottom after the user acting selection performance, however, when I tried to drag the scroll to go to the top, it still is forced to make the scroll down to the bottom, and I want to ask any solution to resolve it? Thanks in advance.
private void autoScrollToBottom() {
sdPanel.getTabScrollPane().getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
e.getAdjustable().setValue(e.getAdjustable().getMaximum());
}
});
}