hBar.setVisible(hVisible); vBar.setVisible(vVisible);
if (hBar != null) hBar.setVisible(hVisible); if (vBar != null) vBar.setVisible(vVisible);
private void resize() {	if (content == null) return;	if (inResize) return;	inResize = true;	ScrollBar hBar = getHorizontalBar ();	ScrollBar vBar = getVerticalBar ();	Rectangle contentRect = content.getBounds();	contentRect.x = contentRect.y = 0;		if (!alwaysShowScroll) {		boolean hVisible = needHScroll(contentRect, false);		boolean vVisible = needVScroll(contentRect, hVisible);		if (!hVisible && vVisible) hVisible = needHScroll(contentRect, vVisible);		hBar.setVisible(hVisible);		vBar.setVisible(vVisible);	}	Rectangle hostRect = getClientArea();	if (expandHorizontal) {		contentRect.width = Math.max(minWidth, hostRect.width);		}	if (expandVertical) {		contentRect.height = Math.max(minHeight, hostRect.height);	}	if (hBar != null) {		hBar.setMaximum (contentRect.width);		hBar.setThumb (Math.min (contentRect.width, hostRect.width));		int hPage = contentRect.width - hostRect.width;		int hSelection = hBar.getSelection ();		if (hSelection >= hPage) {			if (hPage <= 0) hSelection = 0;			contentRect.x = -hSelection;		}	}	if (vBar != null) {		vBar.setMaximum (contentRect.height);		vBar.setThumb (Math.min (contentRect.height, hostRect.height));		int vPage = contentRect.height - hostRect.height;		int vSelection = vBar.getSelection ();		if (vSelection >= vPage) {			if (vPage <= 0) vSelection = 0;			contentRect.y = -vSelection;		}	}		content.setBounds (contentRect);	inResize = false;}