public int getSelectedIndex(Object component) {
		String classname = getClass(component);
		if (("combobox".equals(classname)) || ("tabbedpane".equals(classname))) {
			return getInteger(component, "selected",
					("combobox".equals(classname)) ? -1 : 0);
		}
		if (("list".equals(classname)) || ("table".equals(classname))
				|| ("header".equals(classname)) || ("tree".equals(classname))) {
			Object item = get(component, ":comp");
			for (int i = 0; item != null; i++) {
				if (getBoolean(item, "selected", false)) {
					return i;
				}
				item = get(item, ":next");
			}
			return -1;
		}
		throw new IllegalArgumentException(classname);
	}