public static int findAnchors(Component base, Container ancestorContainer) {
		int contact = AnchorConstraints.ANCHOR_TOP | AnchorConstraints.ANCHOR_LEFT | AnchorConstraints.ANCHOR_BOTTOM | AnchorConstraints.ANCHOR_RIGHT;

		Component comp = base.getParent();
		Component child = base;
		while(comp != null && comp != ancestorContainer && contact != 0) {
			if(comp instanceof SplitContainer) {
				SplitContainer sc = (SplitContainer) comp;
				if(sc.getOrientation() == JSplitPane.VERTICAL_SPLIT) {
					if(sc.getTopComponent() == child) {
						contact = contact & (~ AnchorConstraints.ANCHOR_BOTTOM); // not at bottom
					} else {
						contact = contact & (~ AnchorConstraints.ANCHOR_TOP); // not on top
					}
				} else {
					if(sc.getLeftComponent() == child) {
						contact = contact & (~ AnchorConstraints.ANCHOR_RIGHT); // not right
					} else {
						contact = contact & (~ AnchorConstraints.ANCHOR_LEFT); // not left
					}
				}
			}
			child = comp;
			comp = comp.getParent();
		}
		return contact;
	}