public static int getIndexOf(Container parent, Component child) {
		if (parent != null) {
			int count = parent.getComponentCount();
			for (int i = 0; i < count; i++) {
				if (child == parent.getComponent(i)) {
					return i;
				}
			}
		}
		return -1;
	}