setSelectedValue public void setSelectedValue(Object anObject, boolean shouldScroll) Selects the specified object from the list. Parameters: anObject - the object to select shouldScroll - true if the list should scroll to display the selected object, if one exists; otherwise false 选择的对象会滚动到能见 位置,被选中,但是应该不一定是第一行,不知道是否满足你的要求
public void setSelectedValue(Object anObject,
boolean shouldScroll)
Selects the specified object from the list. Parameters:
anObject - the object to select
shouldScroll - true if the list should scroll to display the selected object, if one exists; otherwise false
选择的对象会滚动到能见 位置,被选中,但是应该不一定是第一行,不知道是否满足你的要求