I have a JList populated with data. When the user has double clicked on one of the items in the list, I need to maniupulate that item. I have implemented the MouseListener which returns an index of the row the user has clicked on. How do I then get the actual data from that row back? I have used a corresponding linkedlist to store the data displayed in the JList, so that I can search through that using the index returned by the mouse click but this seems a bit long-winded Thanks Emma
posted 16 years ago
From JList: getSelectedValue() should be simplest. Alternately getModel().getElementAt(index) will do it.