Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Object[] javax.swing.JList.getSelectedValues()
  2. getSelectedValues
  3. @Deprecated
  4. public Object[] getSelectedValues()
  5. Deprecated. As of JDK 1.7, replaced by getSelectedValuesList()
  6. Returns an array of all the selected values, in increasing order based on their indices in the list.
  7. Returns:
  8. the selected values, or an empty array if nothing is selected
  9. See Also:
  10. isSelectedIndex(int), getModel(), addListSelectionListener(javax.swing.event.ListSelectionListener)
  11.  
  12. private JList LeftList = new JList();
  13. private JList RightList = new JList();
  14. private JButton Move = new JButton("Move -->");
  15.  
  16. private static String[] Items = {"Item 1", "Item 2","Item 3","Item 4","Item 5"};
  17.  
  18. rightList.setListData(leftList.getSelectedValuesList().toArray());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement