int maxY = Math.max(myThumbBounds.y, thumbPos) + myThumbBounds.height; myThumbBounds.y = thumbPos; onThumbMove(); repaint(myThumbBounds.x, minY, myThumbBounds.width, maxY - minY); int maxX = Math.max(myThumbBounds.x, thumbPos) + myThumbBounds.width; myThumbBounds.x = thumbPos; onThumbMove(); repaint(minX, myThumbBounds.y, maxX - minX, myThumbBounds.height);
int y = (value < max - extent) ? convert(myTrackBounds.height - height, value - min, range - extent) : maxY; myThumbBounds.setBounds(myTrackBounds.x, adjust(y, myTrackBounds.y, maxY), myTrackBounds.width, height); if (myOldValue != value) onThumbMove(); if (!myScrollBar.getComponentOrientation().isLeftToRight()) x = myTrackBounds.x - x + maxX; myThumbBounds.setBounds(adjust(x, myTrackBounds.x, maxX), myTrackBounds.y, width, myTrackBounds.height); if (myOldValue != value) onThumbMove();