Component c = getParent(); if (c != null && c instanceof JComponent) { ((JComponent) c).computeVisibleRect(rect); rect.translate(-getX(), -getY()); Rectangle2D.intersect(rect, new Rectangle(0, 0, getWidth(), getHeight()), rect); } else rect.setRect(0, 0, getWidth(), getHeight());
	public void computeVisibleRect(Rectangle rect)	{		//Returns the Component's "visible rect rectangle" - the intersection of the visible rectangles for this component and all of its ancestors.		//super.computeVisibleRect(rect);	}