java的列表怎么取值
java的列表怎么取值?
swing JList
int getSelectedIndex()
Returns the smallest selected cell index the selection when only a single item is selected in the list.
int[] getSelectedIndices()
Returns an array of all of the selected indices, in increasing order.
Object getSelectedValue()
Returns the value for the smallest selected cell index the selected value when only a single item is selected in the list.
Object[] getSelectedValues()
Returns an array of all the selected values, in increasing order based on their indices in the list.