summaryrefslogtreecommitdiff
path: root/javax/swing/JList.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/swing/JList.java')
-rw-r--r--javax/swing/JList.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/javax/swing/JList.java b/javax/swing/JList.java
index 55978a4c6..eab6be3c3 100644
--- a/javax/swing/JList.java
+++ b/javax/swing/JList.java
@@ -1475,19 +1475,18 @@ public class JList extends JComponent implements Accessible, Scrollable
}
/**
- * Returns all the values in the list's {@link #model} property which
- * are selected, according to the list's {@link #selectionModel} property.
- *
+ * Returns all the values in the list's {@link #model} property which are
+ * selected, according to the list's {@link #selectionModel} property.
+ *
* @return An array containing all the selected values
- *
* @see #setSelectedValue
*/
public Object[] getSelectedValues()
{
- int [] idx = getSelectedIndices();
- Object [] v = new Object[idx.length];
+ int[] idx = getSelectedIndices();
+ Object[] v = new Object[idx.length];
for (int i = 0; i < idx.length; ++i)
- v[i] = getModel().getElementAt(i);
+ v[i] = getModel().getElementAt(idx[i]);
return v;
}