Add one more event (as stated here) in the adjustmentValueChanged
of AdjustmentListener
class.
If event type is AdjustmentEvent.TRACK
then also print a statement.
if(e.getValueIsAdjusting())
{
System.out.println("AdjustmentEvent");
}
if(scroll.getValueIsAdjusting())
{
System.out.println("JScrollBar");
}
if(e.getAdjustmentType() == AdjustmentEvent.TRACK)
{
System.out.println("The button in scrollbar clicked");
}
This will capture the button click action on the JScrollBar
.