int extent = scrollPane.getHorizontalExtent();
    protected void updateScrollBars(SScrollPane scrollPane) {        SScrollBar horizontalScroller = scrollPane.getHorizontalScrollBar();        SScrollBar verticalScroller = scrollPane.getVerticalScrollBar();        Scrollable scrollable = scrollPane.getScrollable();                horizontalScroller.setBlockIncrement( scrollPane.getHorizontalExtent() - 1 );        verticalScroller.setBlockIncrement( scrollPane.getVerticalExtent() - 1 );                int policy = 0;                Dimension dim = scrollable.getScrollableViewportSize();        if (dim.width != horizontalScroller.getMaximum()) {            int maximum = dim.width;            int extent = scrollPane.getHorizontalExtent();            if (maximum < extent)                extent = maximum;            int value = horizontalScroller.getValue();            int maxValue = maximum - extent + 1;            if (value > maxValue)                value = maxValue;                        horizontalScroller.setValues(value, extent, 0, maximum);            policy = scrollPane.getHorizontalScrollBarPolicy();            horizontalScroller.setVisible((maximum > extent ||                                            policy == scrollPane.HORIZONTAL_SCROLLBAR_ALWAYS) &&                                          policy != scrollPane.HORIZONTAL_SCROLLBAR_NEVER );        }        if (dim.height != verticalScroller.getMaximum()) {            int maximum = dim.height;            int extent = scrollPane.getVerticalExtent();            if (maximum < extent)                extent = maximum;            int value = verticalScroller.getValue();            int maxValue = maximum - extent + 1;            if (value > maxValue)                value = maxValue;                        verticalScroller.setValues(value, extent, 0, maximum);            policy = scrollPane.getVerticalScrollBarPolicy();            verticalScroller.setVisible(                                        (                                          maximum > extent ||                                          policy == scrollPane.VERTICAL_SCROLLBAR_ALWAYS                                         ) &&                                        policy != scrollPane.VERTICAL_SCROLLBAR_NEVER );        }    }